From 26f0e06e786701b6fc61d387c8ab0c4d14401dc2 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Sat, 15 Jul 2017 18:20:02 -0700 Subject: [PATCH] display only complete units of time fixes #283 --- isso/js/app/utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/isso/js/app/utils.js b/isso/js/app/utils.js index f971770..d8f3970 100644 --- a/isso/js/app/utils.js +++ b/isso/js/app/utils.js @@ -20,8 +20,8 @@ define(["app/i18n"], function(i18n) { secs = 0; } - var mins = Math.ceil(secs / 60), hours = Math.ceil(mins / 60), - days = Math.ceil(hours / 24); + var mins = Math.floor(secs / 60), hours = Math.floor(mins / 60), + days = Math.floor(hours / 24); return secs <= 45 && i18n.translate("date-now") || secs <= 90 && i18n.pluralize("date-minute", 1) || @@ -31,11 +31,11 @@ define(["app/i18n"], function(i18n) { hours <= 36 && i18n.pluralize("date-day", 1) || days <= 5 && i18n.pluralize("date-day", days) || days <= 8 && i18n.pluralize("date-week", 1) || - days <= 21 && i18n.pluralize("date-week", Math.ceil(days / 7)) || + days <= 21 && i18n.pluralize("date-week", Math.floor(days / 7)) || days <= 45 && i18n.pluralize("date-month", 1) || - days <= 345 && i18n.pluralize("date-month", Math.ceil(days / 30)) || + days <= 345 && i18n.pluralize("date-month", Math.floor(days / 30)) || days <= 547 && i18n.pluralize("date-year", 1) || - i18n.pluralize("date-year", Math.ceil(days / 365.25)); + i18n.pluralize("date-year", Math.floor(days / 365.25)); }; var HTMLEntity = {