You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2013/04/28 11:36:20 UTC

[1/2] git commit: [flex-sdk] - FLEX-33516 fixed parsing dates so that it support DD/MM/YYYY format in non eu_US locales

Updated Branches:
  refs/heads/develop ec1ac280b -> 55b14753e


FLEX-33516 fixed parsing dates so that it support DD/MM/YYYY format in non eu_US locales


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/0ca90020
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/0ca90020
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/0ca90020

Branch: refs/heads/develop
Commit: 0ca900201017848ae1d3a05679604d47e1417e7c
Parents: 9084f81
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 28 18:13:06 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 28 18:13:06 2013 +1000

----------------------------------------------------------------------
 .../framework/src/mx/formatters/DateFormatter.as   |   19 +++++++++++----
 1 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/0ca90020/frameworks/projects/framework/src/mx/formatters/DateFormatter.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/formatters/DateFormatter.as b/frameworks/projects/framework/src/mx/formatters/DateFormatter.as
index b82b2b1..5c3d8c7 100644
--- a/frameworks/projects/framework/src/mx/formatters/DateFormatter.as
+++ b/frameworks/projects/framework/src/mx/formatters/DateFormatter.as
@@ -106,6 +106,10 @@ public class DateFormatter extends Formatter
      *
      *  <pre>
      *  var myDate:Date = DateFormatter.parseDateString("2009-12-02 23:45:30"); </pre>
+	 * 
+	 *  The optional format property is use to work out which is likly to be encountered
+	 *  first a month or a date of the month for date where it may not be obvious which
+	 *  comes first.
      *  
      *  @see mx.formatters.DateBase
      * 
@@ -118,7 +122,7 @@ public class DateFormatter extends Formatter
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-    public static function parseDateString (str:String):Date
+    public static function parseDateString (str:String, format:String = null):Date
     {
         if (!str || str == "")
             return null;
@@ -297,12 +301,17 @@ public class DateFormatter extends Formatter
                 // assign num to year or month or day or sec.
                 else if (punctuation.hasOwnProperty(letter) && punctuation[letter].date)
                 {
-					// FIXME assumes month come before day ie US style
-					// dates MM/DD/YYYY or year first dates YYYY/MM/DD
-					if (mon < 0)
+					var monthFirst:Boolean = year != -1;
+					
+					if (format)
+						monthFirst = monthFirst || format.search("M") < format.search("D");
+							
+					if (monthFirst && mon < 0)
                         mon = (num - 1);
 					else if (day < 0)
 						day = num;
+					else if (!monthFirst && mon < 0)
+						mon = (num -1);
 					else if (sec < 0)
 						sec = num;
 					else if (milli < 0)
@@ -670,7 +679,7 @@ public class DateFormatter extends Formatter
 
         if (value is String)
         {
-            value = DateFormatter.parseDateString(String(value));
+            value = DateFormatter.parseDateString(String(value), formatString);
             if (!value)
             {
                 error = defaultInvalidValueError;


[2/2] git commit: [flex-sdk] - Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/flex-sdk into develop

Posted by jm...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/flex-sdk into develop


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/55b14753
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/55b14753
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/55b14753

Branch: refs/heads/develop
Commit: 55b14753ef09b3fc4d2461b9a98a2e6b36ff0c6b
Parents: 0ca9002 ec1ac28
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Apr 28 19:35:51 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Apr 28 19:35:51 2013 +1000

----------------------------------------------------------------------
 .../spark/src/spark/components/DataGrid.as         |   21 +++++
 .../projects/spark/src/spark/components/Grid.as    |   60 +++++++++++++++
 .../supportClasses/IDataProviderEnhance.as         |   11 +++
 .../spark/components/supportClasses/ListBase.as    |   60 +++++++++++++++
 4 files changed, 152 insertions(+), 0 deletions(-)
----------------------------------------------------------------------