Fixed date/time format pattern

pull/214/head
M66B 1 year ago
parent 3474561692
commit 72006d2021

@ -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…
Cancel
Save