[jira] Created: (OFBIZ-613) Order Date i18n problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-613) Order Date i18n problem

Nicolas Malin (Jira)
Order Date i18n problem
-----------------------

                 Key: OFBIZ-613
                 URL: https://issues.apache.org/jira/browse/OFBIZ-613
             Project: Apache OFBiz (The Open for Business Project)
          Issue Type: Bug
          Components: order
    Affects Versions: SVN trunk
            Reporter: Guido Amarilla
            Priority: Minor


The month name is always formatted in english in the date field of an Order PDF.
Testing with the locale set to Spanish instead of "Enero 10, 2007" or "10 de Enero de 2007" it is formatted "January 10, 2007".

in orderReportHeaderInfo.fo.ftl : line 24

<#assign dateFormat = Static["java.text.DateFormat"].LONG>
                      <#assign orderDate = Static["java.text.DateFormat"].getDateInstance(dateFormat).format( orderHeader.get ("orderDate"))>

This is always formatted in english

A solution would be to to format it according to the current selected locale. (I don´t know how to get an instance of it in a ftl file to be used with java.text.DateFormat)
Or if it is not possible, at least to use the same format that is used in every web screen: YYYY-MM-DD



--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-613) Order Date i18n problem

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463777 ]

Guido Amarilla commented on OFBIZ-613:
--------------------------------------

The solution is very simple: just change this line

orderReportHeaderInfo.fo.ftl : line 31

<#assign orderDate = Static["java.text.DateFormat"].getDateInstance(dateFormat).format(orderHeader.get("orderDate"))>

and add the locale in the call to getDateInstance

<#assign orderDate = Static["java.text.DateFormat"].getDateInstance(dateFormat,locale).format(orderHeader.get("orderDate"))>

I tested it and works OK.

> Order Date i18n problem
> -----------------------
>
>                 Key: OFBIZ-613
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-613
>             Project: Apache OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: order
>    Affects Versions: SVN trunk
>            Reporter: Guido Amarilla
>            Priority: Minor
>
> The month name is always formatted in english in the date field of an Order PDF.
> Testing with the locale set to Spanish instead of "Enero 10, 2007" or "10 de Enero de 2007" it is formatted "January 10, 2007".
> in orderReportHeaderInfo.fo.ftl : line 24
> <#assign dateFormat = Static["java.text.DateFormat"].LONG>
>                       <#assign orderDate = Static["java.text.DateFormat"].getDateInstance(dateFormat).format( orderHeader.get ("orderDate"))>
> This is always formatted in english
> A solution would be to to format it according to the current selected locale. (I don´t know how to get an instance of it in a ftl file to be used with java.text.DateFormat)
> Or if it is not possible, at least to use the same format that is used in every web screen: YYYY-MM-DD

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira