diff options
Diffstat (limited to 'main/src/cgeo/geocaching/utils/Formatter.java')
| -rw-r--r-- | main/src/cgeo/geocaching/utils/Formatter.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/utils/Formatter.java b/main/src/cgeo/geocaching/utils/Formatter.java index c764c5a..db649d8 100644 --- a/main/src/cgeo/geocaching/utils/Formatter.java +++ b/main/src/cgeo/geocaching/utils/Formatter.java @@ -76,6 +76,10 @@ public abstract class Formatter { return dateFormat.format(date); } + private static String formatShortDateIncludingWeekday(final long time) { + return DateUtils.formatDateTime(CgeoApplication.getInstance().getBaseContext(), time, DateUtils.FORMAT_SHOW_WEEKDAY | DateUtils.FORMAT_ABBREV_WEEKDAY) + ", " + formatShortDate(time); + } + /** * Generate a numeric date string according to system-wide settings (locale, date format) * such as "10/20/2010". Today and yesterday will be presented as strings "today" and "yesterday". @@ -85,7 +89,7 @@ public abstract class Formatter { * @return the formatted string */ public static String formatShortDateVerbally(final long date) { - final int diff = cgeo.geocaching.utils.DateUtils.daysSince(date); + final int diff = CalendarUtils.daysSince(date); switch (diff) { case 0: return CgeoApplication.getInstance().getString(R.string.log_today); @@ -157,7 +161,7 @@ public abstract class Formatter { } else if (cache.isEventCache()) { final Date hiddenDate = cache.getHiddenDate(); if (hiddenDate != null) { - infos.add(Formatter.formatShortDate(hiddenDate.getTime())); + infos.add(Formatter.formatShortDateIncludingWeekday(hiddenDate.getTime())); } } } @@ -190,7 +194,7 @@ public abstract class Formatter { } public static String formatDaysAgo(final long date) { - final int days = cgeo.geocaching.utils.DateUtils.daysSince(date); + final int days = CalendarUtils.daysSince(date); switch (days) { case 0: return CgeoApplication.getInstance().getString(R.string.log_today); @@ -204,7 +208,6 @@ public abstract class Formatter { /** * Formatting of the hidden date of a cache * - * @param cache * @return {@code null} or hidden date of the cache (or event date of the cache) in human readable format */ public static String formatHiddenDate(final Geocache cache) { |
