[
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