flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cframp...@apache.org
Subject svn commit: r1432122 - /flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
Date Fri, 11 Jan 2013 16:10:22 GMT
Author: cframpton
Date: Fri Jan 11 16:10:21 2013
New Revision: 1432122

URL: http://svn.apache.org/viewvc?rev=1432122&view=rev
Log:
FLEX-33347 - If DateSpinner is in dateAndTime mode you can't spin forward from Jan 31 to date
in February or if set on March 31 can't spin forward to date in April, etc. The fix is to
set the date variable's month field before the date field (day of the month).  If the date
is Jan 31 and you set the month to February, since Feb 31 isn't valid, Flash sets the month
to March.  Unfortunately I don't think there is a workaround for this bug.

Modified:
    flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as

Modified: flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
URL: http://svn.apache.org/viewvc/flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as?rev=1432122&r1=1432121&r2=1432122&view=diff
==============================================================================
--- flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
(original)
+++ flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
Fri Jan 11 16:10:21 2013
@@ -1893,12 +1893,15 @@ public class DateSpinner extends Skinnab
                     break;
                 case dateList:
                     // for DATE_AND_TIME mode data is a Date.time value
+                    // Must set date before the month to ensure the date is valid for the
+                    // month.  If newDate is Jan 31 and you set the month to Feb it will
change
+                    // the month to March since Feb 31 is not a valid date.
                     if (displayMode == DateSelectorDisplayMode.DATE_AND_TIME)
                     {
                         var spinnerDate:Date = new Date(newValue.data);
                         newDate.fullYear = spinnerDate.fullYear;
-                        newDate.month = spinnerDate.month;
                         newDate.date = spinnerDate.date;
+                        newDate.month = spinnerDate.month;
                     }
                     else if (!dateRolledBack) // don't tamper with date if we already rolled
it back
                     {



Mime
View raw message