1
0
mirror of https://framagit.org/tom79/fedilab-tube synced 2025-02-16 12:00:42 +01:00
This commit is contained in:
Thomas 2020-09-24 07:31:46 +02:00
parent b81257c77c
commit 9361f6ca64

View File

@ -375,10 +375,14 @@ public class Helper {
if (years > 0) {
return format;
} else if (months > 0 || days > 7) {
//Removes the year depending of the locale from DateFormat.SHORT format
SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.LONG, Locale.getDefault());
df.applyPattern(df.toPattern().replaceAll("[^\\p{Alpha}]*y+[^\\p{Alpha}]*", ""));
return df.format(dateToot);
try {
//Removes the year depending of the locale from DateFormat.SHORT format
SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.LONG, Locale.getDefault());
df.applyPattern(df.toPattern().replaceAll("[^\\p{Alpha}]*y+[^\\p{Alpha}]*", ""));
return df.format(dateToot);
} catch (Exception e) {
return format;
}
} else if (days > 0)
return context.getString(R.string.date_day, days);
else if (hours > 0)