Custom Date Format

Hello,

I would like to use a custom date format in my ListGrid. Unfortunately I cannot use the date formats provided in DateDisplayFormat, as the dates in my country (Germany) are written with dots, not with slashes: e.g. 24.03.2009 instead of 24/03/2009

Also, I have a case where I only want so display month and year of a date and not the day: e.g. 03/2009

Is it possible to define custom date formats with SmartGWT?

Your help is very much appreciated.

Thanks,
Rudiger

You can use a cell formatter and format the date in the desired format using GWT’s DateFormat class.

Sanjiv

Thanks

Ok, thanks! That worked really fine!

Is is also possible to use a custom date format in a DynamicForm? As far as I can tell, there is no way to specify a cell formatter for a FormItem.

Hi,

How to format the date with an dynamicForm? I have the same problem …

No cell Formatter for a DateItem :frowning:

Thanks

Look at the global input and output formatter methods in DataUtil.

Thank you, it works with the class DateUtil

Hi,

Can anyone provide me with a sample code on using custom date format in list and form?

Thank you.

how do we use CellFormatter and gwt DateFormat?

great!! it really worked. :slight_smile: