From efbbc5307c7853b9af8b87dd913e0456520e67a9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 17 Sep 2016 11:15:07 +0200 Subject: [PATCH] change the daycode to YYYYMMdd --- .../main/java/com/simplemobiletools/calendar/Formatter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/calendar/Formatter.java b/app/src/main/java/com/simplemobiletools/calendar/Formatter.java index 7beaae29c..8d7cc9b35 100644 --- a/app/src/main/java/com/simplemobiletools/calendar/Formatter.java +++ b/app/src/main/java/com/simplemobiletools/calendar/Formatter.java @@ -8,7 +8,7 @@ import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; public class Formatter { - public static final String DAYCODE_PATTERN = "YYMMdd"; + public static final String DAYCODE_PATTERN = "YYYYMMdd"; private static final String DAY_PATTERN = "d"; private static final String YEAR_PATTERN = "YYYY"; private static final String EVENT_DATE_PATTERN = "d YYYY"; // MMMM doesn't give the proper month name in some languages @@ -18,7 +18,7 @@ public class Formatter { final DateTime dateTime = getDateTimeFromCode(dayCode); final String day = dateTime.toString(DAY_PATTERN); final String year = dateTime.toString(YEAR_PATTERN); - final int monthIndex = Integer.valueOf(dayCode.substring(2, 4)) - 1; + final int monthIndex = Integer.valueOf(dayCode.substring(4, 6)) - 1; final String month = getMonthName(context, monthIndex); String date = month + " " + day; if (!year.equals(new DateTime().toString(YEAR_PATTERN)))