Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF 2.0 format date according to the locale

 
Alex Indus
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
I'm creating my first JSF 2.0 application and I've faced with a strange problem: there are two links for selecting preferable language, when user click on one of this links the page is reloaded and page language is changed. Everything works fine except the date formatting - I need to click in the change language link once again to apply date formatting, it delayed by one step. E.g. I choose "En(US)" and all dates should be in mm/dd/yy format but they don't change(default format is dd.mm.yyyy) until I click any other link.
For setting locale I use code from this tutorial Localization article
Code from common layout page

Links for changing locale


Backing bean

Can anyone help me with this problem?
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I seem to recall that the convertDateTime element javadocs explicitly say that it always works in GMT unless you code an alternative locale on the convertDateTime element itself. There is no provision for a global setting. So changing the View root locale wouldn't help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic