mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 22:21:18 +00:00
Debug: date/time formats
This commit is contained in:
parent
0bc6945591
commit
100ee7a7b5
2 changed files with 30 additions and 2 deletions
|
@ -1516,6 +1516,34 @@ public class DebugHelper {
|
|||
size += write(os, String.format("Double tap timeout=%d\r\n", ViewConfiguration.getDoubleTapTimeout()));
|
||||
size += write(os, String.format("Long press timeout=%d\r\n", ViewConfiguration.getLongPressTimeout()));
|
||||
|
||||
String s = Helper.getTimePattern(context, SimpleDateFormat.SHORT);
|
||||
String m = Helper.getTimePattern(context, SimpleDateFormat.MEDIUM);
|
||||
|
||||
size += write(os, String.format("Time 24h=%b\r\n",
|
||||
android.text.format.DateFormat.is24HourFormat(context)));
|
||||
size += write(os, String.format("Time short format=%s time=%s\r\n", s,
|
||||
new SimpleDateFormat(s).format(now)));
|
||||
size += write(os, String.format("Time medium format=%s time=%s\r\n", m,
|
||||
new SimpleDateFormat(m).format(now)));
|
||||
size += write(os, String.format("Time short=%s\r\n",
|
||||
Helper.getTimeInstance(context, SimpleDateFormat.SHORT).format(now)));
|
||||
size += write(os, String.format("Time medium=%s\r\n",
|
||||
Helper.getTimeInstance(context, SimpleDateFormat.MEDIUM).format(now)));
|
||||
size += write(os, String.format("Time long=%s\r\n",
|
||||
Helper.getTimeInstance(context, SimpleDateFormat.LONG).format(now)));
|
||||
size += write(os, String.format("Date short=%s\r\n",
|
||||
Helper.getDateInstance(context, SimpleDateFormat.SHORT).format(now)));
|
||||
size += write(os, String.format("Date medium=%s\r\n",
|
||||
Helper.getDateInstance(context, SimpleDateFormat.MEDIUM).format(now)));
|
||||
size += write(os, String.format("Date long=%s\r\n",
|
||||
Helper.getDateInstance(context, SimpleDateFormat.LONG).format(now)));
|
||||
size += write(os, String.format("Date/time short=%s\r\n",
|
||||
Helper.getDateTimeInstance(context, SimpleDateFormat.SHORT, SimpleDateFormat.SHORT).format(now)));
|
||||
size += write(os, String.format("Date/time medium=%s\r\n",
|
||||
Helper.getDateTimeInstance(context, SimpleDateFormat.MEDIUM, SimpleDateFormat.MEDIUM).format(now)));
|
||||
size += write(os, String.format("Date/time long=%s\r\n",
|
||||
Helper.getDateTimeInstance(context, SimpleDateFormat.LONG, SimpleDateFormat.LONG).format(now)));
|
||||
|
||||
for (Class<?> cls : new Class[]{
|
||||
ActivitySendSelf.class,
|
||||
ActivitySearch.class,
|
||||
|
|
|
@ -2218,7 +2218,7 @@ public class Helper {
|
|||
return getDateInstance(context, SimpleDateFormat.MEDIUM);
|
||||
}
|
||||
|
||||
private static DateFormat getDateInstance(Context context, int style) {
|
||||
static DateFormat getDateInstance(Context context, int style) {
|
||||
return SimpleDateFormat.getDateInstance(style);
|
||||
}
|
||||
|
||||
|
@ -2240,7 +2240,7 @@ public class Helper {
|
|||
return SimpleDateFormat.getDateTimeInstance(dateStyle, timeStyle);
|
||||
}
|
||||
|
||||
private static String getTimePattern(Context context, int style) {
|
||||
static String getTimePattern(Context context, int style) {
|
||||
// https://issuetracker.google.com/issues/37054851
|
||||
boolean is24Hour = android.text.format.DateFormat.is24HourFormat(context);
|
||||
String skeleton = (is24Hour ? "Hm" : "hm");
|
||||
|
|
Loading…
Reference in a new issue