myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Heinen" <michael.hei...@recommind.com>
Subject RE: Date output depending on the userlocale?
Date Thu, 30 Oct 2008 12:33:53 GMT
Yes, you can simply specify the various date formats in resource bundles
and use the pattern in converters:

Sample:
<h:outputText id="aDate" value="#{MyBean.mydate}">
   <x:convertDateTime pattern="#{msgs['dateFormat]}"/>
</h:outputText>

messages.en
dateFormat = DD/MM/YYYY

messages.de
dateFormat = DD-MM-YYYY

Michael

-----Original Message-----
From: Felix.Becker@t-systems.com [mailto:Felix.Becker@t-systems.com] 
Sent: Donnerstag, 30. Oktober 2008 12:44
To: users@myfaces.apache.org
Subject: Date output depending on the userlocale?

Hi *,

is it possible to configure the date format which is used for the output
of Date-objects for every locale - for example in the locale resource
bundle or in the faces-config.xml?

Example:

Locale en_US DD/MM/YYYY
Locale de_DE DD-MM-YYYY
Locale en_EN DD-MM.YYYY 

Thanks and best regards,

Felix Becker


Mime
View raw message