Adds ability to localize timestamps.

This commit is contained in:
Vavassor 2017-07-14 19:45:26 -04:00
commit d55181ccd0
3 changed files with 47 additions and 13 deletions

View file

@ -169,7 +169,7 @@ public class StatusViewHolder extends RecyclerView.ViewHolder {
if (createdAt != null) {
long then = createdAt.getTime();
long now = new Date().getTime();
readout = DateUtils.getRelativeTimeSpanString(then, now);
readout = DateUtils.getRelativeTimeSpanString(sinceCreated.getContext(), then, now);
readoutAloud = android.text.format.DateUtils.getRelativeTimeSpanString(then, now,
android.text.format.DateUtils.SECOND_IN_MILLIS,
android.text.format.DateUtils.FORMAT_ABBREV_RELATIVE);