You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2012/09/25 18:26:07 UTC

[jira] [Created] (LANG-828) FastDateParser does not handle non-Gregorian calendars properly

Sebb created LANG-828:
-------------------------

             Summary: FastDateParser does not handle non-Gregorian calendars properly
                 Key: LANG-828
                 URL: https://issues.apache.org/jira/browse/LANG-828
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.time.*
    Affects Versions: 3.1
            Reporter: Sebb
            Assignee: Sebb


The following calendars are non-Gregorian [1]:

ja_JP_JP - Japanese Imperial)
th_TH (with any variant) - Thai Buddhist

This causes errors when testing round-trip conversions.

The simplest solution is to fall back to SimpleDateFormat for these calendars.

[1] http://docs.oracle.com/javase/6/docs/technotes/guides/intl/calendar.doc.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (LANG-828) FastDateParser does not handle non-Gregorian calendars properly

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved LANG-828.
-----------------------

    Resolution: Fixed

URL: http://svn.apache.org/viewvc?rev=1390626&view=rev
Log:
LANG-828 FastDateParser does not handle non-Gregorian calendars properly
Use Calendar#getDisplayNames() instead of DateFormatSymbols#getEras()

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java

                
> FastDateParser does not handle non-Gregorian calendars properly
> ---------------------------------------------------------------
>
>                 Key: LANG-828
>                 URL: https://issues.apache.org/jira/browse/LANG-828
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>    Affects Versions: 3.1
>            Reporter: Sebb
>             Fix For: 3.2
>
>
> The following calendars are non-Gregorian [1]:
> ja_JP_JP - Japanese Imperial)
> th_TH (with any variant) - Thai Buddhist
> This causes errors when testing round-trip conversions.
> The simplest solution is to fall back to SimpleDateFormat for these calendars.
> [1] http://docs.oracle.com/javase/6/docs/technotes/guides/intl/calendar.doc.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (LANG-828) FastDateParser does not handle non-Gregorian calendars properly

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved LANG-828.
-----------------------

       Resolution: Fixed
    Fix Version/s: 3.2
         Assignee:     (was: Sebb)

URL: http://svn.apache.org/viewvc?rev=1389976&view=rev
Log:
LANG-828 FastDateParser does not handle non-Gregorian calendars properly

Modified:
    commons/proper/lang/trunk/src/changes/changes.xml
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java

                
> FastDateParser does not handle non-Gregorian calendars properly
> ---------------------------------------------------------------
>
>                 Key: LANG-828
>                 URL: https://issues.apache.org/jira/browse/LANG-828
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>    Affects Versions: 3.1
>            Reporter: Sebb
>             Fix For: 3.2
>
>
> The following calendars are non-Gregorian [1]:
> ja_JP_JP - Japanese Imperial)
> th_TH (with any variant) - Thai Buddhist
> This causes errors when testing round-trip conversions.
> The simplest solution is to fall back to SimpleDateFormat for these calendars.
> [1] http://docs.oracle.com/javase/6/docs/technotes/guides/intl/calendar.doc.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (LANG-828) FastDateParser does not handle non-Gregorian calendars properly

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb reopened LANG-828:
-----------------------


Much searching and experimentation reveals that the reason for the problems is as mentioned here: [1]

i.e. DateFormatSymbols#getEras() returns a pair of strings for Gregorian calendar AD and BC; the method does not return the correct eras for th_TH or ja_JP_JP locales.

Also, these locales have long and short versions.

The solution is as mentioned in [1], i.e. use

Calendar.getDisplayNames(Calendar.ERA, Calendar.SHORT, locale);

for all locales.

[1] https://issues.apache.org/jira/browse/TRINIDAD-2126
                
> FastDateParser does not handle non-Gregorian calendars properly
> ---------------------------------------------------------------
>
>                 Key: LANG-828
>                 URL: https://issues.apache.org/jira/browse/LANG-828
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>    Affects Versions: 3.1
>            Reporter: Sebb
>             Fix For: 3.2
>
>
> The following calendars are non-Gregorian [1]:
> ja_JP_JP - Japanese Imperial)
> th_TH (with any variant) - Thai Buddhist
> This causes errors when testing round-trip conversions.
> The simplest solution is to fall back to SimpleDateFormat for these calendars.
> [1] http://docs.oracle.com/javase/6/docs/technotes/guides/intl/calendar.doc.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira