webtier@glassfish.java.net

Re: Error messages when converting time with f:convertDateTime

From: <webtier_at_javadesktop.org>
Date: Fri, 10 Sep 2010 06:34:08 PDT

http://stackoverflow.com/questions/3615458/date-error-when-converting-time-with-fconvertdatetime

[i]Unfortunately, that's also what the DateTimeConverter javadoc is telling. Here's an extract of relevance:

If a pattern has been specified, its syntax must conform the rules specified by java.text.SimpleDateFormat. Such a pattern will be used to parse, and the type, dateStyle, and timeStyle properties will be ignored.

I must however admit that the JSF boys had to specify it explicitly in the f:convertDateTime pdldoc as well. It's not obvious from there. I'd report an issue to the JSF boys to get them to clarify this part.

To get it to work, your best bet is either not relying on the pattern, but on type, dateStyle and timeStyle (and the locale) instead, or create a custom date time converter which extends DateTimeConverter and overrides the methods accordingly.[/i]
[Message sent by forum member 'vetler']

http://forums.java.net/jive/thread.jspa?messageID=482266