Skip to content

Commit d18ed51

Browse files
committed
fix: linter fixes
1 parent 2f5f31c commit d18ed51

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Date/Month.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ function Month(props: MonthSingleProps | MonthRangeProps | MonthMultiProps) {
120120
)
121121
: undefined
122122

123+
const validDisabledDates = validRange?.disabledDates
124+
? validRange?.disabledDates
125+
: undefined
126+
123127
const { monthName, month, year } = React.useMemo(() => {
124128
const md = addMonths(new Date(), realIndex)
125129
const y = md.getFullYear()
@@ -159,8 +163,12 @@ function Month(props: MonthSingleProps | MonthRangeProps | MonthMultiProps) {
159163

160164
const isFirstDayOfMonth = dayOfMonth === 1
161165
const isLastDayOfMonth = dayOfMonth === daysInMonth
162-
163-
inDisabledDates = validRange?.disabledDates ? validRange.disabledDates.some(disabledDate => areDatesOnSameDay(disabledDate, day)) : false
166+
167+
inDisabledDates = validDisabledDates
168+
? validDisabledDates.some((disabledDate) =>
169+
areDatesOnSameDay(disabledDate, day)
170+
)
171+
: false
164172
if (inDisabledDates) {
165173
disabled = true
166174
}
@@ -280,6 +288,7 @@ function Month(props: MonthSingleProps | MonthRangeProps | MonthMultiProps) {
280288
dates,
281289
validRangeStart,
282290
validRangeEnd,
291+
validDisabledDates,
283292
mode,
284293
])
285294

0 commit comments

Comments
 (0)