diff options
Diffstat (limited to 'main/src/cgeo/geocaching/ui/Formatter.java')
| -rw-r--r-- | main/src/cgeo/geocaching/ui/Formatter.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/ui/Formatter.java b/main/src/cgeo/geocaching/ui/Formatter.java index 53a7276..60fb3e6 100644 --- a/main/src/cgeo/geocaching/ui/Formatter.java +++ b/main/src/cgeo/geocaching/ui/Formatter.java @@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils; import android.content.Context; import android.text.format.DateUtils; +import java.text.DateFormat; import java.util.ArrayList; import java.util.List; @@ -70,8 +71,8 @@ public abstract class Formatter { * @return the formatted string */ public static String formatShortDate(long date) { - return DateUtils.formatDateTime(context, date, DateUtils.FORMAT_SHOW_DATE - | DateUtils.FORMAT_NUMERIC_DATE); + DateFormat dateFormat = android.text.format.DateFormat.getDateFormat(context); + return dateFormat.format(date); } /** @@ -153,8 +154,9 @@ public abstract class Formatter { public static String formatWaypointInfo(cgWaypoint waypoint) { final List<String> infos = new ArrayList<String>(3); - if (WaypointType.ALL_TYPES_EXCEPT_OWN.contains(waypoint.getWaypointType())) { - infos.add(waypoint.getWaypointType().getL10n()); + WaypointType waypointType = waypoint.getWaypointType(); + if (waypointType != WaypointType.OWN && waypointType != null) { + infos.add(waypointType.getL10n()); } if (cgWaypoint.PREFIX_OWN.equalsIgnoreCase(waypoint.getPrefix())) { infos.add(cgeoapplication.getInstance().getString(R.string.waypoint_custom)); |
