Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 3 of 3 total |
Show date as mm/dd/yy in Data Grid |
Sun, Jul 14 2019 11:40 PM | Permanent Link |
KimHJ Comca Systems, Inc | Is it possible to change the date column in a grid to show the date as MM/dd/yy instead of showing it like it is stored in the database yyyy-MM-dd?
The grid is connected to a Date Column in a EDB dataset. I tried to check Localize in the dataset, but no luck. Thanks, Kim |
Wed, Jul 17 2019 8:38 AM | Permanent Link |
Uli Becker | > Is it possible to change the date column in a grid to show the date as MM/dd/yy instead of showing it like it is stored in the database yyyy-MM-dd?
Did you use the format settings? If not put it in the initialization section of your main form like this (German format settings in this case): initialization FormatSettings.Translations.Values['DLG_BTN_CANCEL']:='Abbrechen'; FormatSettings.Translations.Values['DLG_BTN_YES']:='Ja'; FormatSettings.Translations.Values['DLG_BTN_NO']:='Nein'; FormatSettings.DecimalSeparator := ','; FormatSettings.DateSeparator:= '.'; FormatSettings.ShortdateFormat := 'dd.MM.yyyy'; FormatSettings.ShortTimeFormat := 'HH:mm'; FormatSettings.LongDayNames[1] := 'Montag'; FormatSettings.LongDayNames[2] := 'Dienstag'; FormatSettings.LongDayNames[3] := 'Mittwoch'; FormatSettings.LongDayNames[4] := 'Donnerstag'; FormatSettings.LongDayNames[5] := 'Freitag'; FormatSettings.LongDayNames[6] := 'Samstag'; FormatSettings.LongDayNames[7] := 'Sonntag'; FormatSettings.ShortDayNames[1] := 'Mo'; FormatSettings.ShortDayNames[2] := 'Di'; FormatSettings.ShortDayNames[3] := 'Mi'; FormatSettings.ShortDayNames[4] := 'Do'; FormatSettings.ShortDayNames[5] := 'Fr'; FormatSettings.ShortDayNames[6] := 'Sa'; FormatSettings.ShortDayNames[7] := 'So'; FormatSettings.LongMonthNames[1] := 'Januar'; FormatSettings.LongMonthNames[2] := 'Februar'; FormatSettings.LongMonthNames[3] := 'März'; FormatSettings.LongMonthNames[4] := 'April'; FormatSettings.LongMonthNames[5] := 'Mai'; FormatSettings.LongMonthNames[6] := 'Juni'; FormatSettings.LongMonthNames[7] := 'Juli'; FormatSettings.LongMonthNames[8] := 'August'; FormatSettings.LongMonthNames[9] := 'September'; FormatSettings.LongMonthNames[10] := 'Oktober'; FormatSettings.LongMonthNames[11] := 'November'; FormatSettings.LongMonthNames[12] := 'Dezember'; end. Uli |
Wed, Jul 17 2019 11:28 PM | Permanent Link |
KimHJ Comca Systems, Inc | Uli Becker wrote:
>>Did you use the format settings? If not put it in the initialization section of your main form like this (German format settings in this case): initialization FormatSettings.Translations.Values['DLG_BTN_CANCEL']:='Abbrechen'; FormatSettings.Translations.Values['DLG_BTN_YES']:='Ja'; FormatSettings.Translations.Values['DLG_BTN_NO']:='Nein'; FormatSettings.DecimalSeparator := ','; FormatSettings.DateSeparator:= '.'; FormatSettings.ShortdateFormat := 'dd.MM.yyyy'; FormatSettings.ShortTimeFormat := 'HH:mm'; FormatSettings.LongDayNames[1] := 'Montag'; FormatSettings.LongDayNames[2] := 'Dienstag'; FormatSettings.LongDayNames[3] := 'Mittwoch'; FormatSettings.LongDayNames[4] := 'Donnerstag'; FormatSettings.LongDayNames[5] := 'Freitag'; FormatSettings.LongDayNames[6] := 'Samstag'; FormatSettings.LongDayNames[7] := 'Sonntag'; FormatSettings.ShortDayNames[1] := 'Mo'; FormatSettings.ShortDayNames[2] := 'Di'; FormatSettings.ShortDayNames[3] := 'Mi'; FormatSettings.ShortDayNames[4] := 'Do'; FormatSettings.ShortDayNames[5] := 'Fr'; FormatSettings.ShortDayNames[6] := 'Sa'; FormatSettings.ShortDayNames[7] := 'So'; FormatSettings.LongMonthNames[1] := 'Januar'; FormatSettings.LongMonthNames[2] := 'Februar'; FormatSettings.LongMonthNames[3] := 'März'; FormatSettings.LongMonthNames[4] := 'April'; FormatSettings.LongMonthNames[5] := 'Mai'; FormatSettings.LongMonthNames[6] := 'Juni'; FormatSettings.LongMonthNames[7] := 'Juli'; FormatSettings.LongMonthNames[8] := 'August'; FormatSettings.LongMonthNames[9] := 'September'; FormatSettings.LongMonthNames[10] := 'Oktober'; FormatSettings.LongMonthNames[11] := 'November'; FormatSettings.LongMonthNames[12] := 'Dezember'; end. << Thanks, for opening my eyes. I have serval other programs made with EWB and all of the have the date showing right. The different in this application is, I use the FormatSettings to format the date to get the data for the Grid. FormatSettings.ShortDateFormat := 'yyyy MM dd'; FormatSettings.DateSeparator := '-'; FindClock.Params.Clear; FindClock.Params.Add('ClockDate>=' + QuotedStr(DateToStr(FromDate))) I was not aware that that would change the way it was displayed in the Grid. I added the new FormatSettings in AfterLoad of the DataSet and now it display just as it should. Thanks, Kim |
This web page was last updated on Wednesday, October 9, 2024 at 05:37 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |