From 47ff78ef9f780da1880b1997c68cf55f444b3f86 Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Fri, 1 Jun 2012 08:10:01 +0200 Subject: fix #1658: show today literally --- main/src/cgeo/geocaching/LogEntry.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'main/src/cgeo/geocaching/LogEntry.java') diff --git a/main/src/cgeo/geocaching/LogEntry.java b/main/src/cgeo/geocaching/LogEntry.java index 31a9703..e03dc66 100644 --- a/main/src/cgeo/geocaching/LogEntry.java +++ b/main/src/cgeo/geocaching/LogEntry.java @@ -1,6 +1,7 @@ package cgeo.geocaching; import cgeo.geocaching.enumerations.LogType; +import cgeo.geocaching.utils.DateUtils; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -94,15 +95,6 @@ public final class LogEntry { } public int daysSinceLog() { - final Calendar logDate = Calendar.getInstance(); - logDate.setTimeInMillis(date); - logDate.set(Calendar.SECOND, 0); - logDate.set(Calendar.MINUTE, 0); - logDate.set(Calendar.HOUR, 0); - final Calendar today = Calendar.getInstance(); - today.set(Calendar.SECOND, 0); - today.set(Calendar.MINUTE, 0); - today.set(Calendar.HOUR, 0); - return (int) Math.round((today.getTimeInMillis() - logDate.getTimeInMillis()) / 86400000d); + return DateUtils.daysSince(date); } } -- cgit v1.1