Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
Refactor utils
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomka committed Jan 15, 2018
1 parent 317d0b4 commit 45a82a3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ export function monthDays (year, month) {
export function monthDayIsDisabled (minDate, maxDate, year, month, day) {
const date = DateTime.fromObject({ year, month, day })

if (minDate) {
minDate = minDate.set({ hour: 0, minute: 0, seconds: 0, milliseconds: 0 })
}

if (maxDate) {
maxDate = maxDate.set({ hour: 0, minute: 0, seconds: 0, milliseconds: 0 })
}
minDate = minDate ? clearTime(minDate) : null
maxDate = maxDate ? clearTime(maxDate) : null

return (minDate && date < minDate) ||
(maxDate && date > maxDate)
Expand Down

0 comments on commit 45a82a3

Please sign in to comment.