mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-08 01:53:25 +02:00
Fixed date/time format pattern
This commit is contained in:
@@ -2192,7 +2192,11 @@ public class Helper {
|
||||
boolean thisDay = (cal0.get(Calendar.DAY_OF_MONTH) == cal1.get(Calendar.DAY_OF_MONTH));
|
||||
if (withDate) {
|
||||
try {
|
||||
String skeleton = (thisMonth && thisYear ? "MMM-d" : "yyyy-M-d") + (withTime ? " Hm" : "");
|
||||
String skeleton = (thisMonth && thisYear ? "MMM-d" : "yyyy-M-d");
|
||||
if (withTime) {
|
||||
boolean is24Hour = android.text.format.DateFormat.is24HourFormat(context);
|
||||
skeleton += (is24Hour ? " Hm" : " hm");
|
||||
}
|
||||
String format = android.text.format.DateFormat.getBestDateTimePattern(Locale.getDefault(), skeleton);
|
||||
return new SimpleDateFormat(format).format(millis);
|
||||
} catch (Throwable ex) {
|
||||
|
||||
Reference in New Issue
Block a user