diff options
| author | Bananeweizen <Bananeweizen@gmx.de> | 2013-10-04 16:05:09 +0200 |
|---|---|---|
| committer | Bananeweizen <Bananeweizen@gmx.de> | 2013-10-04 16:05:09 +0200 |
| commit | f1f5743cc65222435042c85b13b3d2302a891504 (patch) | |
| tree | 2836f4c8c063c7a7d03c68a50ba0b2dc53e8f8c9 /main/src/cgeo | |
| parent | 40ce9ae42db5f83abf6fcf9b3a6a6df6c21ac246 (diff) | |
| download | cgeo-f1f5743cc65222435042c85b13b3d2302a891504.zip cgeo-f1f5743cc65222435042c85b13b3d2302a891504.tar.gz cgeo-f1f5743cc65222435042c85b13b3d2302a891504.tar.bz2 | |
change: use long date format in field note export dialog
Diffstat (limited to 'main/src/cgeo')
| -rw-r--r-- | main/src/cgeo/geocaching/export/FieldnoteExport.java | 2 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/ui/Formatter.java | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/export/FieldnoteExport.java b/main/src/cgeo/geocaching/export/FieldnoteExport.java index d59434a..05c62e3 100644 --- a/main/src/cgeo/geocaching/export/FieldnoteExport.java +++ b/main/src/cgeo/geocaching/export/FieldnoteExport.java @@ -83,7 +83,7 @@ class FieldnoteExport extends AbstractExport { final CheckBox onlyNewOption = (CheckBox) layout.findViewById(R.id.onlynew); if (Settings.getFieldnoteExportDate() > 0) { - onlyNewOption.setText(getString(R.string.export_fieldnotes_onlynew) + "\n(" + Formatter.formatShortDateTime(Settings.getFieldnoteExportDate()) + ')'); + onlyNewOption.setText(getString(R.string.export_fieldnotes_onlynew) + "\n(" + Formatter.formatDateTime(Settings.getFieldnoteExportDate()) + ')'); } builder.setPositiveButton(R.string.export, new DialogInterface.OnClickListener() { diff --git a/main/src/cgeo/geocaching/ui/Formatter.java b/main/src/cgeo/geocaching/ui/Formatter.java index 963807f..49c7a50 100644 --- a/main/src/cgeo/geocaching/ui/Formatter.java +++ b/main/src/cgeo/geocaching/ui/Formatter.java @@ -1,9 +1,9 @@ package cgeo.geocaching.ui; +import cgeo.geocaching.CgeoApplication; import cgeo.geocaching.Geocache; import cgeo.geocaching.R; import cgeo.geocaching.Waypoint; -import cgeo.geocaching.CgeoApplication; import cgeo.geocaching.enumerations.CacheListType; import cgeo.geocaching.enumerations.CacheSize; import cgeo.geocaching.enumerations.WaypointType; @@ -107,6 +107,18 @@ public abstract class Formatter { return DateUtils.formatDateTime(context, date, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_ABBREV_ALL); } + /** + * Generate a numeric date and time string according to system-wide settings (locale, + * date format) such as "7 september at 12:35". + * + * @param date + * milliseconds since the epoch + * @return the formatted string + */ + public static String formatDateTime(long date) { + return DateUtils.formatDateTime(context, date, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME); + } + public static String formatCacheInfoLong(Geocache cache, CacheListType cacheListType) { final ArrayList<String> infos = new ArrayList<String>(); if (StringUtils.isNotBlank(cache.getGeocode())) { |
