Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fe1e622 authored by Eric Fischer's avatar Eric Fischer
Browse files

Make the Date Picker fields more consistent in locales with numeric months.

In locales that use month numbers instead of names, use *just* the number
instead of also the word for month to be consistent with the other fields,
which also show just a number instead of a number plus the word for day
or year.

Bug 2289276
parent fdcba38c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -103,6 +103,18 @@ public class DatePicker extends FrameLayout {
        mMonthPicker.setFormatter(NumberPicker.TWO_DIGIT_FORMATTER);
        DateFormatSymbols dfs = new DateFormatSymbols();
        String[] months = dfs.getShortMonths();

        /*
         * If the user is in a locale where the month names are numeric,
         * use just the number instead of the "month" character for
         * consistency with the other fields.
         */
        if (months[0].startsWith("1")) {
            for (int i = 0; i < months.length; i++) {
                months[i] = String.valueOf(i + 1);
            }
        }

        mMonthPicker.setRange(1, 12, months);
        mMonthPicker.setSpeed(200);
        mMonthPicker.setOnChangeListener(new OnChangedListener() {