Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman, a=ritu
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Mon, 11 Jan 2016 11:41:51 -0800
changeset 292521 3517ff00b87a27e55af244e353ef7607a0264639
parent 292520 ad6e0f8d7bd3090eaf6cf6169c12542a9fe7dfa3
child 292522 0488d79e6d74cfb4513ed65252c5104e1535e1ce
push id254
push usercbook@mozilla.com
push dateWed, 13 Jan 2016 11:04:22 +0000
reviewersrnewman, ritu
bugs1236212
milestone44.0
Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman, a=ritu
mobile/android/base/widget/DateTimePicker.java
--- a/mobile/android/base/widget/DateTimePicker.java
+++ b/mobile/android/base/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);