tr:chooseDate date format different then DateFormat.getDateTimeInstance(DateFormat.SHORT

View: New views
3 Messages — Rating Filter:   Alert me  

tr:chooseDate date format different then DateFormat.getDateTimeInstance(DateFormat.SHORT

by JeroenM :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Friends,

I'm having trouble with the tr:chooseDate component. For some reason the component returns a different format (MM/dd/yyyy) than the default format defined by my regional settings (dd-mm-yyyy).

If I test the format with code like

String today = DateFormat.getDateTimeInstance(DateFormat.SHORT,  DateFormat.SHORT).format(date);
System.out.println("Today " + today);

The result is correct, however the calendar control gives me an (mm/dd/yyyy) notation. Is there any way to override / correct this?


Re: tr:chooseDate date format different then DateFormat.getDateTimeInstance(DateFormat.SHORT

by JeroenM :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I found out that adding <tr:convertDateTime pattern="dd-MM-yyyy"/> to the calendar solved my problem. Unfortunate this doesn't apply regional settings

Re: tr:chooseDate date format different then DateFormat.getDateTimeInstance(DateFormat.SHORT

by Yee-wah Lee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

JeroenM wrote:
> I found out that adding <tr:convertDateTime pattern="dd-MM-yyyy"/> to the
> calendar solved my problem. Unfortunate this doesn't apply regional settings
>
>  
Hi Jeroen,

Do you have <formatting-locale> set in trinidad-config.xml?
http://myfaces.apache.org/trinidad/devguide/configuration.html

Yee-Wah