UX: round instead of ceil for time gaps

This commit is contained in:
Neil Lalonde 2017-09-28 14:11:37 -04:00
parent d2d272c5f1
commit c7aa354ee8

View File

@ -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});
}
}