FIX: Update relativeAgeMedium to be consistent with relativeAgeTiny.

This commit is contained in:
Guo Xiang Tan 2015-08-31 00:14:57 +08:00
parent 50ce95b37d
commit d3fea106fc
2 changed files with 6 additions and 4 deletions

View File

@ -189,10 +189,10 @@ function relativeAgeMediumSpan(distance, leaveAgo) {
case(distanceInMinutes >= 56 && distanceInMinutes <= 89):
formatted = t("x_hours", {count: 1});
break;
case(distanceInMinutes >= 90 && distanceInMinutes <= 1379):
case(distanceInMinutes >= 90 && distanceInMinutes <= 1409):
formatted = t("x_hours", {count: Math.round(distanceInMinutes / 60.0)});
break;
case(distanceInMinutes >= 1380 && distanceInMinutes <= 2159):
case(distanceInMinutes >= 1410 && distanceInMinutes <= 2159):
formatted = t("x_days", {count: 1});
break;
case(distanceInMinutes >= 2160):

View File

@ -52,7 +52,8 @@ test("formating medium length dates", function() {
equal(strip(formatMins(56)), "1 hour ago");
equal(strip(formatHours(4)), "4 hours ago");
equal(strip(formatHours(22)), "22 hours ago");
equal(strip(formatHours(23)), "1 day ago");
equal(strip(formatHours(23)), "23 hours ago");
equal(strip(formatHours(23.5)), "1 day ago");
equal(strip(formatDays(4.85)), "4 days ago");
leaveAgo = false;
@ -63,7 +64,8 @@ test("formating medium length dates", function() {
equal(strip(formatMins(56)), "1 hour");
equal(strip(formatHours(4)), "4 hours");
equal(strip(formatHours(22)), "22 hours");
equal(strip(formatHours(23)), "1 day");
equal(strip(formatHours(23)), "23 hours");
equal(strip(formatHours(23.5)), "1 day");
equal(strip(formatDays(4.85)), "4 days");
equal(strip(formatDays(6)), shortDate(6));