mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 22:06:33 +08:00
UX: round instead of ceil for time gaps
This commit is contained in:
parent
d2d272c5f1
commit
c7aa354ee8
|
@ -8,10 +8,10 @@ function description(attrs) {
|
||||||
if (daysSince < 30) {
|
if (daysSince < 30) {
|
||||||
return I18n.t('dates.later.x_days', {count: daysSince});
|
return I18n.t('dates.later.x_days', {count: daysSince});
|
||||||
} else if (daysSince < 365) {
|
} else if (daysSince < 365) {
|
||||||
const gapMonths = Math.ceil(daysSince / 30);
|
const gapMonths = Math.round(daysSince / 30);
|
||||||
return I18n.t('dates.later.x_months', {count: gapMonths});
|
return I18n.t('dates.later.x_months', {count: gapMonths});
|
||||||
} else {
|
} else {
|
||||||
const gapYears = Math.ceil(daysSince / 365);
|
const gapYears = Math.round(daysSince / 365);
|
||||||
return I18n.t('dates.later.x_years', {count: gapYears});
|
return I18n.t('dates.later.x_years', {count: gapYears});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user