From 95c66654aa1b9421294b206d384980f1494efdc6 Mon Sep 17 00:00:00 2001 From: Grishka Date: Fri, 13 May 2022 19:20:40 +0300 Subject: [PATCH] Fix #149 --- .../main/java/org/joinmastodon/android/ui/utils/UiUtils.java | 4 +++- mastodon/src/main/res/values/strings.xml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java index 4f09289a..e40a4a7e 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java @@ -107,7 +107,9 @@ public class UiUtils{ long t=instant.toEpochMilli(); long now=System.currentTimeMillis(); long diff=now-t; - if(diff<60_000L){ + if(diff<1000L){ + return context.getString(R.string.time_now); + }else if(diff<60_000L){ return context.getString(R.string.time_seconds, diff/1000L); }else if(diff<3600_000L){ return context.getString(R.string.time_minutes, diff/60_000L); diff --git a/mastodon/src/main/res/values/strings.xml b/mastodon/src/main/res/values/strings.xml index 939ac102..46691427 100644 --- a/mastodon/src/main/res/values/strings.xml +++ b/mastodon/src/main/res/values/strings.xml @@ -339,4 +339,5 @@ %,d reblogs %1$s via %2$s + now \ No newline at end of file