Paul,

This kind of request comes up with regularity, and I'm going the suggest the same thing now that I have suggested before: Make the FreeMarker date-time format configurable and supply a patch to Jira.

I believe it would be a simple matter of modifying FreeMarkerWorker.java (line 93) to load the format from a properties file, or do nothing if the property doesn't exist - which would cause FreeMarker to use the user's locale for date-time formatting.

-Adrian


On 8/11/2011 1:17 PM, Paul Foxworthy wrote:
Hi Bilgin,

I want consistency. If dates appear with some format because they are
presented by the display widget or an input field, they should be in the
same format when presented by a Freemarker template. I should not have to
repeatedly express the date format I want in each Freemarker template.

Cheers

Paul Foxworthy


Bilgin Ibryam-2 wrote:
On Tue, Aug 9, 2011 at 1:54 AM, Paul Foxworthy<[email protected]>
wrote:
Yes, thanks Bilgin.

Input fields and the display widget use the locale for date formatting,
but
at least some Freemarker templates don't. It would be nice if they were
consistent.

Can you give an example what you want to achieve?

The datetime_format for freemarker in ofbiz is set to yyyy-MM-dd
HH:mm:ss.SSS that's why it is rendered in this format for any locales.

If you want to display timestamps in a specific format containing i18n
part (for example the day/month printed in a specific language) you
can do it by explicitely setting the formatting in that ftl file like
this:

${cartLine.getDesiredDeliveryDate()?string("EEEE, MMMM dd, yyyy,
hh:mm:ss a '('zzz')'")}

HTH
Bilgin Ibryam

Cheers

Paul Foxworthy

--
View this message in context:
http://ofbiz.135035.n4.nabble.com/showcartitems-ftl-should-desired-delivery-date-use-renderDateTimeField-tp3724548p3728726.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

--
View this message in context: 
http://ofbiz.135035.n4.nabble.com/showcartitems-ftl-should-desired-delivery-date-use-renderDateTimeField-tp3724548p3735685.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Reply via email to