Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Thu, 07 Jan 2016 15:58:26 -0500
changeset 320155 29b74b9db879bbbd662c38461c10fad3ad22b977
parent 320154 a54da7831cfcb3dfb2881573cb84cc058f62368b
child 320156 f2c54cd55ed5ee6baecfe6b195292ad682167f5f
push id9143
push userahunt@mozilla.com
push dateFri, 08 Jan 2016 21:30:53 +0000
reviewersrnewman
bugs1236212
milestone46.0a1
Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman
mobile/android/base/java/org/mozilla/gecko/widget/DateTimePicker.java
--- a/mobile/android/base/java/org/mozilla/gecko/widget/DateTimePicker.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/DateTimePicker.java
@@ -349,17 +349,17 @@ public class DateTimePicker extends Fram
 
         // Initialize all spinners.
         mDaySpinner = setupSpinner(R.id.day, 1,
                                    mTempDate.get(Calendar.DAY_OF_MONTH));
         mDaySpinner.setFormatter(TWO_DIGIT_FORMATTER);
         mDaySpinnerInput = (EditText) mDaySpinner.getChildAt(1);
 
         mMonthSpinner = setupSpinner(R.id.month, 1,
-                                     mTempDate.get(Calendar.MONTH));
+                                     mTempDate.get(Calendar.MONTH) + 1); // Month is 0-based
         mMonthSpinner.setFormatter(TWO_DIGIT_FORMATTER);
         mMonthSpinner.setDisplayedValues(mShortMonths);
         mMonthSpinnerInput = (EditText) mMonthSpinner.getChildAt(1);
 
         mWeekSpinner = setupSpinner(R.id.week, 1,
                                     mTempDate.get(Calendar.WEEK_OF_YEAR));
         mWeekSpinner.setFormatter(TWO_DIGIT_FORMATTER);
         mWeekSpinnerInput = (EditText) mWeekSpinner.getChildAt(1);