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

Peter Marcoen edited comment on FLEX-35106 at 7/5/16 11:46 AM:
---------------------------------------------------------------

A work around is to set the formatString:

{code:xml}
<mx:DateField selectedDate="{new Date()}" formatString="DD MMMM YYYY"/>
{code}

The DateField's function stringToDate interprets the text when opening the 
DateChooser (clicking the calendar icon). Since the french locale formats this 
text with a 3-letter month, this function no longer knows which month it really 
is (June or July).

I still think this is a bug. If I set the selectedDate, it should not analyse 
the text but use the selectedDate property. When manually editing the text this 
property could then be changed and then I can accept that the DateField does 
not know which month I really mean.


was (Author: peter.marcoen):
A work around is to set the formatString:

{code:xml}
<mx:DateField selectedDate="{new Date()}" formatString="DD MMMM YYYY"/>
{code}

The DateField's function stringToDate interprets the text when opening the 
DateChooser (clicking the calendar icon). Since the french locale formats this 
text with a 3-letter month, this function no longer knows which month it really 
is (June or July).

I still think this is a bug. If I set the selectedDate, it should not analyse 
the text but use the selectedDate property. When manually editing the text this 
property could be changed.

> Incorrect date in datefield popup for fr_FR locale
> --------------------------------------------------
>
>                 Key: FLEX-35106
>                 URL: https://issues.apache.org/jira/browse/FLEX-35106
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: mx: DateField
>    Affects Versions: Apache Flex 4.15.0
>         Environment: Windows 7
>            Reporter: Peter Marcoen
>              Labels: datefield, french, locale
>
> h4. Steps to reproduce:
> 1. Create a new project
> 2. Set the compiler arguments to "-locale fr_FR"
> 3. Add the following line to the main application:
> {code:xml}
> <mx:DateField selectedDate="{new Date(2016, 6, 4, 13)}"/>
> {code}
> 4. Run the application and click on the calendar icon
> h4. Expected result:
> The selected date should be the 4th of JULY, which it is if you set the 
> locale to "en_US"
> h4. Actual result:
> The selected date is the 4th of JUNE
> h4. Possible reason:
> Because the abbreviation of june and july is the same in French ("Jui"), the 
> popup probably finds the first month who's abbreviated name matches the 
> selected abbreviated name and thus incorrectly sets the month to June



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to