mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Fixed date/time format pattern
This commit is contained in:
parent
3474561692
commit
72006d2021
1 changed files with 5 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue