diff options
author | Erik <roboerik@android.com> | 2010-03-10 15:51:33 -0800 |
---|---|---|
committer | Erik <roboerik@android.com> | 2010-03-10 15:51:33 -0800 |
commit | fed57ecf8784c761b61d40e87c88a2628142d1dd (patch) | |
tree | bf582ad77c912ecbe5d4ece4b3d2fa6fffacefb7 /src/com/android/calendar/EventRecurrenceFormatter.java | |
parent | 7278388c9b666f3d79b2ce4c7eeefe6ceb97aeb4 (diff) | |
download | android_packages_apps_Calendar-fed57ecf8784c761b61d40e87c88a2628142d1dd.tar.gz android_packages_apps_Calendar-fed57ecf8784c761b61d40e87c88a2628142d1dd.tar.bz2 android_packages_apps_Calendar-fed57ecf8784c761b61d40e87c88a2628142d1dd.zip |
b/2504857 Changed EventRecurrenceFormatter to use the same days as DateUtils
EventRecurrenceFormatter was redefining its own set of day numbers which were
different than the ones used by DateUtils. Changed ERF to use the same days
so now they can both be updated from the same place without the hidden
dependency.
Change-Id: Ibafc21b8fbabbbc49fd9cd309f2a8bf63e776b8e
Diffstat (limited to 'src/com/android/calendar/EventRecurrenceFormatter.java')
-rw-r--r-- | src/com/android/calendar/EventRecurrenceFormatter.java | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/com/android/calendar/EventRecurrenceFormatter.java b/src/com/android/calendar/EventRecurrenceFormatter.java index ce621327..06dfed11 100644 --- a/src/com/android/calendar/EventRecurrenceFormatter.java +++ b/src/com/android/calendar/EventRecurrenceFormatter.java @@ -17,7 +17,6 @@ package com.android.calendar; import android.content.res.Resources; -import android.text.TextUtils; import android.text.format.DateUtils; import android.pim.EventRecurrence; @@ -58,7 +57,7 @@ public class EventRecurrenceFormatter return null; } - int day = recurrence.timeDay2Day(recurrence.startDate.weekDay); + int day = EventRecurrence.timeDay2Day(recurrence.startDate.weekDay); return String.format(format, dayToString(day)); } } @@ -81,15 +80,6 @@ public class EventRecurrenceFormatter return DateUtils.getDayOfWeekString(dayToUtilDay(day), DateUtils.LENGTH_LONG); } - // Day of week used by DateUtils - private static final int UTILS_SU = 0; - private static final int UTILS_MO = 1; - private static final int UTILS_TU = 2; - private static final int UTILS_WE = 3; - private static final int UTILS_TH = 4; - private static final int UTILS_FR = 5; - private static final int UTILS_SA = 6; - /** * Converts EventRecurrence's day of week to DateUtil's day of week. * @param day of week as an EventRecurrence value @@ -97,13 +87,13 @@ public class EventRecurrenceFormatter */ private static int dayToUtilDay(int day) { switch (day) { - case EventRecurrence.SU: return UTILS_SU; - case EventRecurrence.MO: return UTILS_MO; - case EventRecurrence.TU: return UTILS_TU; - case EventRecurrence.WE: return UTILS_WE; - case EventRecurrence.TH: return UTILS_TH; - case EventRecurrence.FR: return UTILS_FR; - case EventRecurrence.SA: return UTILS_SA; + case EventRecurrence.SU: return Calendar.SUNDAY; + case EventRecurrence.MO: return Calendar.MONDAY; + case EventRecurrence.TU: return Calendar.TUESDAY; + case EventRecurrence.WE: return Calendar.WEDNESDAY; + case EventRecurrence.TH: return Calendar.THURSDAY; + case EventRecurrence.FR: return Calendar.FRIDAY; + case EventRecurrence.SA: return Calendar.SATURDAY; default: throw new IllegalArgumentException("bad day argument: " + day); } } |