remove unit limit on month

This commit is contained in:
Francis Cao 2023-10-13 14:07:55 -07:00
parent 170a269723
commit 3353277829

View File

@ -238,7 +238,7 @@ export function incrementDateRange(value, increment) {
export function getAllowedUnits(startDate, endDate) {
const units = ['minute', 'hour', 'day', 'month', 'year'];
const minUnit = getMinimumUnit(startDate, endDate);
const index = units.indexOf(minUnit);
const index = units.indexOf(minUnit === 'year' ? 'month' : minUnit);
return index >= 0 ? units.splice(index) : [];
}