From 22dfd4e2923529090264029f726f9de596b5a5f5 Mon Sep 17 00:00:00 2001 From: PhotonQyv Date: Sat, 9 Dec 2017 15:11:02 +0000 Subject: [PATCH] Added a fix for negative timestamps on toots. --- .../main/java/fr/gouv/etalab/mastodon/helper/Helper.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java index e1d21f2c9..5229d18d4 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java @@ -576,8 +576,11 @@ public class Helper { return context.getResources().getQuantityString(R.plurals.date_hours, (int)hours, (int)hours); else if(minutes > 0) return context.getResources().getQuantityString(R.plurals.date_minutes, (int)minutes, (int)minutes); - else - return context.getResources().getQuantityString(R.plurals.date_seconds, (int)seconds, (int)seconds); + else { + if (seconds < 0) + seconds = 0; + return context.getResources().getQuantityString(R.plurals.date_seconds, (int) seconds, (int) seconds); + } } /***