aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/LogEntry.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-06-01 08:10:01 +0200
committerBananeweizen <bananeweizen@gmx.de>2012-06-01 08:10:01 +0200
commit47ff78ef9f780da1880b1997c68cf55f444b3f86 (patch)
tree246a3408ffc474c10b6cbafdf1b20688a6fd67f2 /main/src/cgeo/geocaching/LogEntry.java
parent55546fcc11cb011245566907651f93e1b25ff29a (diff)
downloadcgeo-47ff78ef9f780da1880b1997c68cf55f444b3f86.zip
cgeo-47ff78ef9f780da1880b1997c68cf55f444b3f86.tar.gz
cgeo-47ff78ef9f780da1880b1997c68cf55f444b3f86.tar.bz2
fix #1658: show today literally
Diffstat (limited to 'main/src/cgeo/geocaching/LogEntry.java')
-rw-r--r--main/src/cgeo/geocaching/LogEntry.java12
1 files changed, 2 insertions, 10 deletions
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);
}
}