summaryrefslogtreecommitdiffstats
path: root/core/java/android/text
diff options
context:
space:
mode:
authorSteve Pomeroy <steve@staticfree.info>2012-08-27 02:20:13 -0400
committerSteve Pomeroy <steve@staticfree.info>2012-08-27 02:20:13 -0400
commitca3363775e03e0f90bdf111d3e5c54b3ab16df57 (patch)
tree998e7513c1392bf088c17e13ba2d9adfb26da548 /core/java/android/text
parent13ab2c9fdaec119a40b628ae772fd1462fbb826d (diff)
downloadframeworks_base-ca3363775e03e0f90bdf111d3e5c54b3ab16df57.zip
frameworks_base-ca3363775e03e0f90bdf111d3e5c54b3ab16df57.tar.gz
frameworks_base-ca3363775e03e0f90bdf111d3e5c54b3ab16df57.tar.bz2
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 <steve@staticfree.info>
Diffstat (limited to 'core/java/android/text')
-rw-r--r--core/java/android/text/format/DateUtils.java2
1 files changed, 1 insertions, 1 deletions
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) {