Shorter dates
This commit is contained in:
parent
a165f5cde0
commit
05167022ab
|
@ -575,23 +575,19 @@ public class Helper {
|
|||
long years = days / 365;
|
||||
|
||||
if( years > 0)
|
||||
return context.getResources().getQuantityString(R.plurals.date_year, (int)years, (int)years);
|
||||
return context.getResources().getString(R.string.date_year, (int)years);
|
||||
else if( months > 0)
|
||||
return context.getResources().getQuantityString(R.plurals.date_month, (int)months, (int)months);
|
||||
else if( days > 2)
|
||||
return context.getResources().getString(R.string.date_month, (int)months);
|
||||
else if( days > 0)
|
||||
return context.getString(R.string.date_day, days);
|
||||
else if(days == 2 )
|
||||
return context.getString(R.string.date_day_before_yesterday);
|
||||
else if(days == 1 )
|
||||
return context.getString(R.string.date_yesterday);
|
||||
else if(hours > 0)
|
||||
return context.getResources().getQuantityString(R.plurals.date_hours, (int)hours, (int)hours);
|
||||
return context.getResources().getString(R.string.date_hours, (int)hours);
|
||||
else if(minutes > 0)
|
||||
return context.getResources().getQuantityString(R.plurals.date_minutes, (int)minutes, (int)minutes);
|
||||
return context.getResources().getString(R.string.date_minutes, (int)minutes);
|
||||
else {
|
||||
if (seconds < 0)
|
||||
seconds = 0;
|
||||
return context.getResources().getQuantityString(R.plurals.date_seconds, (int) seconds, (int) seconds);
|
||||
return context.getResources().getString(R.string.date_seconds, (int) seconds);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -137,29 +137,12 @@
|
|||
<item quantity="other">%d replies</item>
|
||||
</plurals>
|
||||
<!-- Date -->
|
||||
<plurals name="date_seconds">
|
||||
<item quantity="one">%d second ago</item>
|
||||
<item quantity="other">%d seconds ago</item>
|
||||
</plurals>
|
||||
<plurals name="date_minutes">
|
||||
<item quantity="one">%d minute ago</item>
|
||||
<item quantity="other">%d minutes ago</item>
|
||||
</plurals>
|
||||
<plurals name="date_hours">
|
||||
<item quantity="one">%d hour ago</item>
|
||||
<item quantity="other">%d hours ago</item>
|
||||
</plurals>
|
||||
<string name="date_yesterday">Yesterday</string>
|
||||
<string name="date_day_before_yesterday">Before yesterday</string>
|
||||
<string name="date_day" formatted="false">%d days ago</string>
|
||||
<plurals name="date_month">
|
||||
<item quantity="one">%d month ago</item>
|
||||
<item quantity="other">%d months ago</item>
|
||||
</plurals>
|
||||
<plurals name="date_year">
|
||||
<item quantity="one">One year ago</item>
|
||||
<item quantity="other">%d years ago</item>
|
||||
</plurals>
|
||||
<string name="date_seconds">%d s</string>
|
||||
<string name="date_minutes">%d min</string>
|
||||
<string name="date_hours">%d h</string>
|
||||
<string name="date_day">%d d</string>
|
||||
<string name="date_month">%d m</string>
|
||||
<string name="date_year">%d y</string>
|
||||
|
||||
<!-- TOOT -->
|
||||
<string name="toot_cw_placeholder">Warning</string>
|
||||
|
|
Loading…
Reference in New Issue