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

This year

This commit is contained in:
M66B 2023-01-22 11:49:53 +01:00
parent 904d6e82f3
commit 82e039f3fe

View file

@ -2005,7 +2005,8 @@ public class Helper {
Calendar cal1 = Calendar.getInstance();
cal0.setTimeInMillis(millis);
boolean thisMonth = (cal0.get(Calendar.MONTH) == cal1.get(Calendar.MONTH));
String skeleton = (thisMonth ? "MMM-d" : "Y-M-d");
boolean thisYear = (cal0.get(Calendar.YEAR) == cal1.get(Calendar.YEAR));
String skeleton = (thisMonth && thisYear ? "MMM-d" : "Y-M-d");
String format = android.text.format.DateFormat.getBestDateTimePattern(Locale.getDefault(), skeleton);
return new SimpleDateFormat(format).format(millis);
}