You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Yee-Wah Lee (JIRA)" <de...@myfaces.apache.org> on 2011/08/11 01:18:28 UTC

[jira] [Commented] (TRINIDAD-2126) convertdatetime fails with datestyle=full, th_th or ja_jp_jp locale

    [ https://issues.apache.org/jira/browse/TRINIDAD-2126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13082748#comment-13082748 ] 

Yee-Wah Lee commented on TRINIDAD-2126:
---------------------------------------

Debugging, the era string used in the LocaleElements_th.js file do not match the strings used by SimpleDateFormat. Thus the client converter fails to parse the eras.

>From discussion with Java folks it's known that DateFormatSymbols#getEras returns a pair of strings for Gregorian calendar AD and BC even if locale is set to
Thai or Japanese Imperial calendar. They think it's by design but need raise a document bug.

To obtain eras for non Gregorian calendars, one need to use Calendar class like following;

   Calendar c = Calendar.getInstance(th);
   String era = c.getDisplayName(Calendar.ERA, Calendar.LONG, th);
   System.out.println("Calendar era: " + era);

 or

   Map<String, Integer> eras = c.getDisplayNames(Calendar.ERA, Calendar.LONG,
th);
   for ( String key : eras.keySet())
       System.out.println("Calendar eras: " + key);


> convertdatetime fails with datestyle=full, th_th or ja_jp_jp locale
> -------------------------------------------------------------------
>
>                 Key: TRINIDAD-2126
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2126
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components, Plugins
>    Affects Versions: 2.0.0
>            Reporter: Yee-Wah Lee
>            Priority: Minor
>
> Create the following jspx: 
>         <tr:inputText id="it1" label="Label 1" value="#{input.date}" autoSubmit="true">
>           <tr:convertDateTime locale="th_TH" dateStyle="full"/>
>         </tr:inputText>
>         <tr:outputText partialTriggers="it1" value="#{input.date}"/>
> Run the page, and modify the date slightly so that it is still valid. Tab
> off, get an error about the message not being in the correct format, though
> the format itself did not change and the date is semantically valid. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira