Fix calculation of weeks.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 2 Feb 2013 21:45:36 +0000 (22:45 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 2 Feb 2013 21:45:36 +0000 (22:45 +0100)
src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java

index 4f54571..b0d9dac 100644 (file)
@@ -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");