Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman, a=sledru
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Thu, 07 Jan 2016 15:58:26 -0500
changeset 310785 044d5043b11dcdd19049b9f9a378b37f1dd6e140
parent 310784 3b8540eb98d18e06eec882571cf6e39cc068c1da
child 310786 60681827670839a14e3700482e7275d87bc3ccb1
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, sledru
bugs1236212
milestone45.0a2
Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman, a=sledru
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);