aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cgeo/geocaching/cgBase.java16
-rw-r--r--src/cgeo/geocaching/cgeopoint.java5
2 files changed, 13 insertions, 8 deletions
diff --git a/src/cgeo/geocaching/cgBase.java b/src/cgeo/geocaching/cgBase.java
index bd54ff7..1b09bd0 100644
--- a/src/cgeo/geocaching/cgBase.java
+++ b/src/cgeo/geocaching/cgBase.java
@@ -5052,7 +5052,6 @@ public class cgBase {
* Generate a time string according to system-wide settings (locale, 12/24 hour)
* such as "13:24".
*
- * @param context a context
* @param date milliseconds since the epoch
* @return the formatted string
*/
@@ -5064,7 +5063,6 @@ public class cgBase {
* Generate a date string according to system-wide settings (locale, date format)
* such as "20 December" or "20 December 2010". The year will only be included when necessary.
*
- * @param context a context
* @param date milliseconds since the epoch
* @return the formatted string
*/
@@ -5077,7 +5075,6 @@ public class cgBase {
* such as "20 December 2010". The year will always be included, making it suitable
* to generate long-lived log entries.
*
- * @param context a context
* @param date milliseconds since the epoch
* @return the formatted string
*/
@@ -5089,7 +5086,6 @@ public class cgBase {
* Generate a numeric date string according to system-wide settings (locale, date format)
* such as "10/20/2010".
*
- * @param context a context
* @param date milliseconds since the epoch
* @return the formatted string
*/
@@ -5098,6 +5094,18 @@ public class cgBase {
}
/**
+ * Generate a numeric date and time string according to system-wide settings (locale,
+ * date format) such as "7 sept. à 12:35".
+ *
+ * @param context a Context
+ * @param date milliseconds since the epoch
+ * @return the formatted string
+ */
+ public static String formatShortDateTime(Context context, long date) {
+ return DateUtils.formatDateTime(context, date, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_ABBREV_ALL);
+ }
+
+ /**
* TODO This method is only needed until the settings are a singleton
* @return
*/
diff --git a/src/cgeo/geocaching/cgeopoint.java b/src/cgeo/geocaching/cgeopoint.java
index dba015d..530f557 100644
--- a/src/cgeo/geocaching/cgeopoint.java
+++ b/src/cgeo/geocaching/cgeopoint.java
@@ -14,7 +14,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
-import android.text.format.DateFormat;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
@@ -66,9 +65,7 @@ public class cgeopoint extends AbstractActivity {
longitude.setText(lonString);
latitude.setText(latString);
- CharSequence dateString = DateFormat.format("dd/MM/yy kk:mm",
- loc.getDate());
- date.setText(dateString);
+ date.setText(cgBase.formatShortDateTime(getContext(), loc.getDate()));
return convertView;
}