mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-02-16 12:00:42 +01:00
Fix date
This commit is contained in:
parent
b81257c77c
commit
9361f6ca64
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user