mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
parent
a712875830
commit
570f79d91a
@ -158,6 +158,7 @@
|
||||
|
||||
<!-- DateUtils -->
|
||||
<string name="DateUtils_now">Now</string>
|
||||
<string name="DateUtils_minutes_ago">%d min</string>
|
||||
|
||||
<!-- ShareActivity -->
|
||||
<string name="ShareActivity_share_with">Share with</string>
|
||||
@ -684,11 +685,6 @@
|
||||
<string name="arrays__use_custom">Use custom</string>
|
||||
|
||||
<!-- plurals.xml -->
|
||||
<plurals name="minutes_ago">
|
||||
<item quantity="one">%d min</item>
|
||||
<item quantity="other">%d mins</item>
|
||||
</plurals>
|
||||
|
||||
<plurals name="hours_ago">
|
||||
<item quantity="one">%d hour</item>
|
||||
<item quantity="other">%d hours</item>
|
||||
|
@ -50,7 +50,7 @@ public class DateUtils extends android.text.format.DateUtils {
|
||||
return c.getString(R.string.DateUtils_now);
|
||||
} else if (isWithin(timestamp, 1, TimeUnit.HOURS)) {
|
||||
int mins = convertDelta(timestamp, TimeUnit.MINUTES);
|
||||
return c.getResources().getQuantityString(R.plurals.minutes_ago, mins, mins);
|
||||
return c.getResources().getString(R.string.DateUtils_minutes_ago, mins);
|
||||
} else if (isWithin(timestamp, 1, TimeUnit.DAYS)) {
|
||||
int hours = convertDelta(timestamp, TimeUnit.HOURS);
|
||||
return c.getResources().getQuantityString(R.plurals.hours_ago, hours, hours);
|
||||
@ -68,7 +68,7 @@ public class DateUtils extends android.text.format.DateUtils {
|
||||
return c.getString(R.string.DateUtils_now);
|
||||
} else if (isWithin(timestamp, 1, TimeUnit.HOURS)) {
|
||||
int mins = (int)TimeUnit.MINUTES.convert(System.currentTimeMillis() - timestamp, TimeUnit.MILLISECONDS);
|
||||
return c.getResources().getQuantityString(R.plurals.minutes_ago, mins, mins);
|
||||
return c.getResources().getString(R.string.DateUtils_minutes_ago, mins);
|
||||
} else {
|
||||
StringBuilder format = new StringBuilder();
|
||||
if (isWithin(timestamp, 6, TimeUnit.DAYS)) format.append("EEE ");
|
||||
|
Loading…
Reference in New Issue
Block a user