Skip to content

Commit

Permalink
remove unit limit on month
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscao633 committed Oct 13, 2023
1 parent 170a269 commit 3353277
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) : [];
}
Expand Down

0 comments on commit 3353277

Please sign in to comment.