From 2ae861a6760a2bd9212287ddf342e291d2bdc87c Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 2 Feb 2013 22:45:36 +0100 Subject: [PATCH] Fix calculation of weeks. --- src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java index 4f54571..b0d9dac 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java @@ -181,7 +181,7 @@ public class GetTimesAjaxPage extends JsonPage { text = webInterface.getL10n().getString("View.Time.AWeekAgo"); refresh = TimeUnit.DAYS.toMillis(1); } else if (age < TimeUnit.DAYS.toMillis(28)) { - text = webInterface.getL10n().getString("View.Time.XWeeksAgo", "week", String.valueOf((TimeUnit.MILLISECONDS.toHours(age) + 84) / 24)); + text = webInterface.getL10n().getString("View.Time.XWeeksAgo", "week", String.valueOf((TimeUnit.MILLISECONDS.toHours(age) + 84) / (7 * 24))); refresh = TimeUnit.DAYS.toMillis(1); } else if (age < TimeUnit.DAYS.toMillis(42)) { text = webInterface.getL10n().getString("View.Time.AMonthAgo"); -- 2.7.4