UX: Round up dates

This commit is contained in:
Robin Ward 2017-09-26 10:13:34 -04:00
parent 9e17fd8907
commit 451340d058
1 changed files with 2 additions and 2 deletions

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.floor(daysSince / 30);
const gapMonths = Math.ceil(daysSince / 30);
return I18n.t('dates.later.x_months', {count: gapMonths});
} else {
const gapYears = Math.floor(daysSince / 365);
const gapYears = Math.ceil(daysSince / 365);
return I18n.t('dates.later.x_years', {count: gapYears});
}
}