mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: Post age time not being translated correctly.
This commit is contained in:
parent
322df1862d
commit
50ce95b37d
2 changed files with 4 additions and 3 deletions
|
@ -142,13 +142,13 @@ function relativeAgeTiny(date){
|
|||
case(distanceInMinutes >= 45 && distanceInMinutes <= 89):
|
||||
formatted = t("about_x_hours", {count: 1});
|
||||
break;
|
||||
case(distanceInMinutes >= 90 && distanceInMinutes <= 1439):
|
||||
case(distanceInMinutes >= 90 && distanceInMinutes <= 1409):
|
||||
formatted = t("about_x_hours", {count: Math.round(distanceInMinutes / 60.0)});
|
||||
break;
|
||||
case(Discourse.SiteSettings.relative_date_duration === 0 && distanceInMinutes <= 525599):
|
||||
formatted = shortDateNoYear(date);
|
||||
break;
|
||||
case(distanceInMinutes >= 1440 && distanceInMinutes <= 2519):
|
||||
case(distanceInMinutes >= 1410 && distanceInMinutes <= 2519):
|
||||
formatted = t("x_days", {count: 1});
|
||||
break;
|
||||
case(distanceInMinutes >= 2520 && distanceInMinutes <= ((Discourse.SiteSettings.relative_date_duration||14) * 1440)):
|
||||
|
@ -266,4 +266,3 @@ export function number(val) {
|
|||
}
|
||||
return val.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,8 @@ test("formating tiny dates", function() {
|
|||
equal(formatMins(2), "2m");
|
||||
equal(formatMins(60), "1h");
|
||||
equal(formatHours(4), "4h");
|
||||
equal(formatHours(23), "23h");
|
||||
equal(formatHours(23.5), "1d");
|
||||
equal(formatDays(1), "1d");
|
||||
equal(formatDays(14), "14d");
|
||||
equal(formatDays(15), shortDate(15));
|
||||
|
|
Loading…
Reference in a new issue