From ca3363775e03e0f90bdf111d3e5c54b3ab16df57 Mon Sep 17 00:00:00 2001 From: Steve Pomeroy Date: Mon, 27 Aug 2012 02:20:13 -0400 Subject: Fixes relative time formatting issue for dates in future All variations of getRelativeTimeSpanString() now properly handle dates that are in the future. Prior, the version used by getRelativeDateTimeString() would occasionally show the time instead of a date when the future date was the same weekday as the current weekday. This resulted in the time output being duplicated, eg.: "11:23, 11:23" Change-Id: If20972a6942cce792fa233437f94dedfb71379f3 Signed-off-by: Steve Pomeroy --- core/java/android/text/format/DateUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/java/android/text') diff --git a/core/java/android/text/format/DateUtils.java b/core/java/android/text/format/DateUtils.java index da10311..211453d 100644 --- a/core/java/android/text/format/DateUtils.java +++ b/core/java/android/text/format/DateUtils.java @@ -1618,7 +1618,7 @@ public class DateUtils String result; long now = System.currentTimeMillis(); - long span = now - millis; + long span = Math.abs(now - millis); synchronized (DateUtils.class) { if (sNowTime == null) { -- cgit v1.1