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 2012/05/22 19:20:40 UTC

[jira] [Created] (TRINIDAD-2269) tr:convertDateTime with dateStyle="long", locale="tr_TR" gives error for certain days

Yee-Wah Lee created TRINIDAD-2269:
-------------------------------------

             Summary: tr:convertDateTime with dateStyle="long", locale="tr_TR" gives error for certain days
                 Key: TRINIDAD-2269
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2269
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions: 2.0.1-core
            Reporter: Yee-Wah Lee
            Priority: Minor


1. Run the following jspx
   <tr:inputDate label="Input date with Turkish locale">
              <tr:convertDateTime dateStyle="long" locale="tr_TR"/>
              </tr:inputDate>
2. Use the date picker to pick Monday (the day names in the picker are not localized).
3. The date field is populated with a string such as "21 Mayıs 2012 Pazartesi"
4. Submit the field - get error "The date is not in the correct format."


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

       

[jira] [Resolved] (TRINIDAD-2269) tr:convertDateTime with dateStyle="long", locale="tr_TR" gives error for certain days

Posted by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-2269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gabrielle Crawford resolved TRINIDAD-2269.
------------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.0-core
    
> tr:convertDateTime with dateStyle="long", locale="tr_TR" gives error for certain days
> -------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-2269
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2269
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.1-core
>            Reporter: Yee-Wah Lee
>            Priority: Minor
>             Fix For: 2.1.0-core
>
>         Attachments: branch121270_2269_TurkishLongDayNames.diff, trunk_2269_turkishDateLongDayNames.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> 1. Run the following jspx
>    <tr:inputDate label="Input date with Turkish locale">
>               <tr:convertDateTime dateStyle="long" locale="tr_TR"/>
>               </tr:inputDate>
> 2. Use the date picker to pick a Monday (the day names in the picker are not localized).
> 3. The date field is populated with a string such as "21 Mayıs 2012 Pazartesi"
> 4. Submit the field - get error "The date is not in the correct format."

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

       

[jira] [Commented] (TRINIDAD-2269) tr:convertDateTime with dateStyle="long", locale="tr_TR" gives error for certain days

Posted by "Yee-Wah Lee (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-2269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281104#comment-13281104 ] 

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

The Turkish day names are like this: {"Pazar", "Pazartesi", "Sal\u0131", "\xc7ar\u015famba", "Per\u015fembe","Cuma", "Cumartesi"}

_matchText in DateFormat.js iterates through the array and calls _matchText with the array[i] as second argument:
function _matchText(parseContext,text)
{
  var textLength  = text.length;

  var parseString = parseContext.parseString;
  var parseText  = parseString.substring(currIndex, currIndex + textLength);

  // Compares the parseText with text
  ...
}
Notice that the code searches for the array's current value (text) against parseContext, rather than chunking parseContext and comparing. In the Turkish case, there are similar date strings like "Pazar"/"Pazartesi" and "Cuma", "Cumartesi" where the 1st string is a substring of the 2nd.

_matchArray returns upon the first successful invocation of _matchText. Subsequently, if the parse string is "Pazartesi" or "Cumartesi", it will match against the earlier index ("Pazar/"Cuma") for the day of the week but the remaining string will fail to parse. E.g. With pattern dd MMMM yyyy EE HH:mm the code mistakenly assigns "<some date> Pazartesi 12:00" the day of the week "Pazar", and the remaining string 'tesi 12:00' will not match the rest of the pattern HH:mm. 
                
> tr:convertDateTime with dateStyle="long", locale="tr_TR" gives error for certain days
> -------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-2269
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2269
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.1-core
>            Reporter: Yee-Wah Lee
>            Priority: Minor
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> 1. Run the following jspx
>    <tr:inputDate label="Input date with Turkish locale">
>               <tr:convertDateTime dateStyle="long" locale="tr_TR"/>
>               </tr:inputDate>
> 2. Use the date picker to pick a Monday (the day names in the picker are not localized).
> 3. The date field is populated with a string such as "21 Mayıs 2012 Pazartesi"
> 4. Submit the field - get error "The date is not in the correct format."

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