diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2013-05-10 18:19:48 +0200 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2013-05-10 18:19:48 +0200 |
commit | a5b35087421a8dbaccca7f54cce71a590e0326ca (patch) | |
tree | 7f169585526b076d2a998d0be6a8caeec47f3d9a | |
parent | e63cc4c4e859c213b39a698aa14004468ad5aba3 (diff) | |
download | cgeo-a5b35087421a8dbaccca7f54cce71a590e0326ca.zip cgeo-a5b35087421a8dbaccca7f54cce71a590e0326ca.tar.gz cgeo-a5b35087421a8dbaccca7f54cce71a590e0326ca.tar.bz2 |
fix #2709: select "attended" as default for past events
-rw-r--r-- | main/src/cgeo/geocaching/VisitCacheActivity.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/VisitCacheActivity.java b/main/src/cgeo/geocaching/VisitCacheActivity.java index cac0f89..99e8597 100644 --- a/main/src/cgeo/geocaching/VisitCacheActivity.java +++ b/main/src/cgeo/geocaching/VisitCacheActivity.java @@ -13,6 +13,7 @@ import cgeo.geocaching.twitter.Twitter; import cgeo.geocaching.ui.Formatter; import cgeo.geocaching.ui.dialog.DateDialog; import cgeo.geocaching.utils.AsyncTaskWithProgress; +import cgeo.geocaching.utils.DateUtils; import cgeo.geocaching.utils.Log; import cgeo.geocaching.utils.LogTemplateProvider; import cgeo.geocaching.utils.LogTemplateProvider.LogContext; @@ -353,7 +354,10 @@ public class VisitCacheActivity extends AbstractLoggingActivity implements DateD date = Calendar.getInstance(); rating = 0.0; if (cache.isEventCache()) { - if (cache.hasOwnLog(LogType.WILL_ATTEND)) { + final Date eventDate = cache.getHiddenDate(); + boolean expired = DateUtils.daysSince(eventDate.getTime()) > 0; + + if (cache.hasOwnLog(LogType.WILL_ATTEND) || expired) { typeSelected = LogType.ATTENDED; } else { |