Página 1 de 1
TDatePicker
Publicado: Vie Abr 01, 2005 8:50 am
por arroba
El tDatePicker no respeta el formato seleccionado en SET DATE ....
Por ejemplo, si tengo seleccionado SET DATE GERMAN que pone la fecha
separada con puntos (01.04.2005), en el tDatePicker salen las barras
(01/04/2005).
Saludos,
Jose Alfonso Suárez
TDatePicker
Publicado: Vie Abr 01, 2005 10:10 am
por jfgimenez
José Alfonso,
> El tDatePicker no respeta el formato seleccionado en SET DATE ....
>
> Por ejemplo, si tengo seleccionado SET DATE GERMAN que pone la fecha
> separada con puntos (01.04.2005), en el tDatePicker salen las barras
> (01/04/2005).
Eso es porque este control es un control de windows, y utiliza el formato de fechas que esté configurado en el panel de control. No obstante, puedes cambiar el formato con la propiedad cCustomFormat. Los formatos válidos tienen esta forma (extraído del API):
Format Strings
A DTP format string consists of a series of elements that represent a particular piece of information and define its display format. The elements will be displayed in the order they appear in the format string.
Date and time format elements will be replaced by the actual date and time. They are defined by the following groups of characters:
Element Description
"d" The one- or two-digit day.
"dd" The two-digit day. Single-digit day values are preceded by a zero.
"ddd" The three-character weekday abbreviation.
"dddd" The full weekday name.
"h" The one- or two-digit hour in 12-hour format.
"hh" The two-digit hour in 12-hour format. Single-digit values are preceded by a zero.
"H" The one- or two-digit hour in 24-hour format.
"HH" The two-digit hour in 24-hour format. Single-digit values are preceded by a zero.
"m" The one- or two-digit minute.
"mm" The two-digit minute. Single-digit values are preceded by a zero.
"M" The one- or two-digit month number.
"MM" The two-digit month number. Single-digit values are preceded by a zero.
"MMM" The three-character month abbreviation.
"MMMM" The full month name.
"t" The one-letter AM/PM abbreviation (that is, AM is displayed as "A").
"tt" The two-letter AM/PM abbreviation (that is, AM is displayed as "AM").
"yy" The last two digits of the year (that is, 1996 would be displayed as "96").
"yyyy" The full year (that is, 1996 would be displayed as "1996").
To make the information more readable, you can add body text to the format string by enclosing it in single quotes. Spaces and punctuation marks do not need to be quoted.
Note Nonformat characters that are not delimited by single quotes will result in unpredictable display by the DTP control.
For example, to display the current date with the format "'Today is: 04:22:31 Tuesday Mar 23, 1996", the format string is "'Today is: 'hh':'m':'s dddd MMM dd', 'yyyy". To include a single quote in your body text, use two consecutive single quotes. For example, "'Don''t forget' MMM dd',' yyyy" produces output that looks like: Don't forget Mar 23, 1996. It is not necessary to use quotes with the comma, so "'Don''t forget' MMM dd, yyyy" is also valid, and produces the same output.
--
Un saludo,
José F. Giménez
--
TDatePicker
Publicado: Vie Abr 01, 2005 4:22 pm
por jasm.nospam
Jose,
Ya me imaginaba que era por eso.
Gracias y un saludo
Jose A. Suarez
Jose F. Gimenez escribió:
> José Alfonso,
>
> > El tDatePicker no respeta el formato seleccionado en SET DATE ....
> >
> > Por ejemplo, si tengo seleccionado SET DATE GERMAN que pone la fecha
> > separada con puntos (01.04.2005), en el tDatePicker salen las barras
> > (01/04/2005).
> Eso es porque este control es un control de windows, y utiliza el
> formato de fechas que esté configurado en el panel de control. No
> obstante, puedes cambiar el formato con la propiedad cCustomFormat. Los
> formatos válidos tienen esta forma (extraído del API):
>
>
>
> Format Strings
>
> A DTP format string consists of a series of elements that represent a
> particular piece of information and define its display format. The
> elements will be displayed in the order they appear in the format string.
>
> Date and time format elements will be replaced by the actual date and
> time. They are defined by the following groups of characters:
>
> Element Description
> "d" The one- or two-digit day.
> "dd" The two-digit day. Single-digit day values are preceded by a zero.
> "ddd" The three-character weekday abbreviation.
> "dddd" The full weekday name.
> "h" The one- or two-digit hour in 12-hour format.
> "hh" The two-digit hour in 12-hour format. Single-digit values are
> preceded by a zero.
> "H" The one- or two-digit hour in 24-hour format.
> "HH" The two-digit hour in 24-hour format. Single-digit values are
> preceded by a zero.
> "m" The one- or two-digit minute.
> "mm" The two-digit minute. Single-digit values are preceded by a zero.
> "M" The one- or two-digit month number.
> "MM" The two-digit month number. Single-digit values are preceded by a
> zero.
> "MMM" The three-character month abbreviation.
> "MMMM" The full month name.
> "t" The one-letter AM/PM abbreviation (that is, AM is displayed as "A").
> "tt" The two-letter AM/PM abbreviation (that is, AM is displayed as "AM").
> "yy" The last two digits of the year (that is, 1996 would be displayed
> as "96").
> "yyyy" The full year (that is, 1996 would be displayed as "1996").
>
> To make the information more readable, you can add body text to the
> format string by enclosing it in single quotes. Spaces and punctuation
> marks do not need to be quoted.
>
> *Note* Nonformat characters that are not delimited by single quotes
> will result in unpredictable display by the DTP control.
>
> For example, to display the current date with the format "'Today is:
> 04:22:31 Tuesday Mar 23, 1996", the format string is "'Today is:
> 'hh':'m':'s dddd MMM dd', 'yyyy". To include a single quote in your body
> text, use two consecutive single quotes. For example, "'Don''t forget'
> MMM dd',' yyyy" produces output that looks like: Don't forget Mar 23,
> 1996. It is not necessary to use quotes with the comma, so "'Don''t
> forget' MMM dd, yyyy" is also valid, and produces the same output.
>
>
> --
> Un saludo,
>
> José F. Giménez
>
TDatePicker
Publicado: Vie Abr 01, 2005 9:37 pm
por jlalin
José Alfonso,
también puedes hacer algo así:
CLASS TMyDatePicker FROM TDatePicker
METHOD Create( oParent, ... )
ENDCLASS
METHOD Create( oParent, ... ) CLASS TMyDatePicker
::cCustomFormat := ElFormatoQueQuieras
Super:Create( oParent, ... )
RETURN Self
No lo he probado pero debería funcionar sin problema.
Saludos,
José Lalín