From 836058320214755c37d919ceb8a192e1c9de1230 Mon Sep 17 00:00:00 2001 From: Phillip Hsu Date: Sat, 3 Jun 2017 17:45:26 -0700 Subject: [PATCH] Change start index to 0 when extracting the front partition of the full date string. --- .../philliphsu/bottomsheetpickers/date/DatePickerDialog.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/DatePickerDialog.java b/bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/DatePickerDialog.java index ddcd5e4..195749c 100644 --- a/bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/DatePickerDialog.java +++ b/bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/DatePickerDialog.java @@ -508,13 +508,13 @@ private void updateDisplay(boolean announce) { if (monthDayStart != -1 && yearStart != -1) { if (mLocaleMonthDayIndex < mLocaleYearIndex) { if (yearStart - monthDayEnd <= 2) { - monthAndDay = fullDate.substring(monthDayStart, yearStart); + monthAndDay = fullDate.substring(0, yearStart); year = fullDate.substring(yearStart, fullDate.length()); processed = true; } } else { if (monthDayStart - yearEnd <= 2) { - year = fullDate.substring(yearStart, monthDayStart); + year = fullDate.substring(0, monthDayStart); monthAndDay = fullDate.substring(monthDayStart, fullDate.length()); processed = true; }