mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 10:15:49 +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) {
|
||||
return I18n.t('dates.later.x_days', {count: daysSince});
|
||||
} 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});
|
||||
} else {
|
||||
const gapYears = Math.ceil(daysSince / 365);
|
||||
const gapYears = Math.round(daysSince / 365);
|
||||
return I18n.t('dates.later.x_years', {count: gapYears});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user