You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Justin Mclean (JIRA)" <ji...@apache.org> on 2013/04/20 05:39:18 UTC

[jira] [Comment Edited] (FLEX-21609) Make the Date.parse locale aware.

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

Justin Mclean edited comment on FLEX-21609 at 4/20/13 3:39 AM:
---------------------------------------------------------------

Both DateField.stringToDate and DateField.dateToString have been improved to support D/M/YYYY and other formats.

The DateField use resourceManager.getString("SharedResources", "dateFormat") in formatString method to set the initial date format so is compiled locale aware. Can override formatString to make it Flash Player locale aware if needed.

Changed set date method so it uses either internal or user provided date function in preference to Date.parse and this gets around the issue. Can set to null if for some odd reason you wanted previous behaviour (can't see why that would be needed).

All DateField mustella tests pass.

Date.parse() is inside the Flash Player so not an Apache Flex issue.
                
      was (Author: jmclean):
    Both DateField.stringToDate and DateField.dateToString have been improved to support D/M/YYYY and other formats.

The DateField use resourceManager.getString("SharedResources", "dateFormat") in formatString method to set the initial date format so is compiled locale aware. Can override formatString to make it Flash Player locale aware if needed.

Changed set date method so it uses either internal or user provided date function in preference to Date.parse and this gets around the issue. Can set to null if for some odd reason you wanted previous behaviour (can't sew why that would be needed).

All DateField mustella tests pass.

Date.parse() is inside the Flash Player so not an Apache Flex issue.
                  
> Make the Date.parse locale aware.
> ---------------------------------
>
>                 Key: FLEX-21609
>                 URL: https://issues.apache.org/jira/browse/FLEX-21609
>             Project: Apache Flex
>          Issue Type: Improvement
>          Components: Formatters, i18n : Formatter Support, mx: DateField, Validators
>    Affects Versions: Adobe Flex SDK Previous
>         Environment: Affected OS(s): All OS Platforms
> Language Found: English
>            Reporter: Adobe JIRA
>            Priority: Minor
>
> Steps to reproduce:
> 1. Set the compiler locale to a non-english one (I used it_IT)
> 2. Add a DateField
> 3. Try to parse the date provided by DateField.text or a date hardcoded in a string with dd/mm/yyyy formatting.
> This issue is somewhat related (and should be linked) to SDK-23683.
>  
>  Actual Results:
>  I tried 4 different parsing methods and I got 4 different results, as in the project attached.
>  
>  Expected Results:
>  I expect that parsing a date without specifying a formatter should try parsing the date with the default formatter for the current locale.
>  
>  Workaround (if any):
> Provide the explicit formatter for the current locale for each date parsed, using only the DateField parser. But the formatter provided should be with english convenctions (DD and YYYY for days and years) and not the localized version of the formatter.

--
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