Fixes issue #234 - Truncated dates
This commit is contained in:
parent
6ffae43600
commit
778645e758
|
@ -587,7 +587,10 @@ public class Helper {
|
|||
if( years > 0 ) {
|
||||
return format;
|
||||
} else if( months > 0 || days > 7) {
|
||||
return format.substring(0,5);
|
||||
//Removes the year depending of the locale from DateFormat.SHORT format
|
||||
SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, Locale.getDefault());
|
||||
df.applyPattern(df.toPattern().replaceAll("[^\\p{Alpha}]*y+[^\\p{Alpha}]*", ""));
|
||||
return df.format(dateToot);
|
||||
}else if( days > 0 )
|
||||
return context.getString(R.string.date_day, days);
|
||||
else if(hours > 0)
|
||||
|
|
Loading…
Reference in New Issue