diff options
author | Erik <roboerik@android.com> | 2010-10-01 11:10:59 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-01 11:10:59 -0700 |
commit | 277465fb5bfc74716f194f1abc2befb42ed73590 (patch) | |
tree | c94f4e1674f6aa1be2f8322b90f6bee591aa3571 /core | |
parent | 14401bf7bca34c692f248406c78bd8b49783217a (diff) | |
parent | 57bd0615fa48124c4607fbb1ba09a7c7160be146 (diff) | |
download | frameworks_base-277465fb5bfc74716f194f1abc2befb42ed73590.zip frameworks_base-277465fb5bfc74716f194f1abc2befb42ed73590.tar.gz frameworks_base-277465fb5bfc74716f194f1abc2befb42ed73590.tar.bz2 |
am 57bd0615: Merge "b/3054044 Make allDay event times format in utc" into gingerbread
Merge commit '57bd0615fa48124c4607fbb1ba09a7c7160be146' into gingerbread-plus-aosp
* commit '57bd0615fa48124c4607fbb1ba09a7c7160be146':
b/3054044 Make allDay event times format in utc
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/util/CalendarUtils.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/util/CalendarUtils.java b/core/java/android/util/CalendarUtils.java index 3d340d9..1b2a894 100644 --- a/core/java/android/util/CalendarUtils.java +++ b/core/java/android/util/CalendarUtils.java @@ -146,6 +146,9 @@ public class CalendarUtils { * This formats a date/time range using Calendar's time zone and the * local conventions for the region of the device. * + * If the {@link DateUtils#FORMAT_UTC} flag is used it will pass in + * the UTC time zone instead. + * * @param context the context is required only if the time is shown * @param startMillis the start time in UTC milliseconds * @param endMillis the end time in UTC milliseconds @@ -156,10 +159,16 @@ public class CalendarUtils { public String formatDateRange(Context context, long startMillis, long endMillis, int flags) { String date; + String tz; + if ((flags & DateUtils.FORMAT_UTC) != 0) { + tz = Time.TIMEZONE_UTC; + } else { + tz = getTimeZone(context, null); + } synchronized (mSB) { mSB.setLength(0); date = DateUtils.formatDateRange(context, mF, startMillis, endMillis, flags, - getTimeZone(context, null)).toString(); + tz).toString(); } return date; } |