1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-24 07:01:05 +00:00

Fixed date/time format pattern

This commit is contained in:
M66B 2023-10-09 08:20:52 +02:00
parent 3474561692
commit 72006d2021

View file

@ -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) {