@@ -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 ( )
@@ -153,11 +157,22 @@ function Month(props: MonthSingleProps | MonthRangeProps | MonthMultiProps) {
153157 let inRange = false
154158 let disabled = false
155159 let selected = false
160+ let inDisabledDates = false
156161 let leftCrop = dayOfMonth === 1
157162 let rightCrop = dayOfMonth === daysInMonth
158163
159164 const isFirstDayOfMonth = dayOfMonth === 1
160165 const isLastDayOfMonth = dayOfMonth === daysInMonth
166+
167+ inDisabledDates = validDisabledDates
168+ ? validDisabledDates . some ( ( disabledDate ) =>
169+ areDatesOnSameDay ( disabledDate , day )
170+ )
171+ : false
172+ if ( inDisabledDates ) {
173+ disabled = true
174+ }
175+
161176 if ( mode === 'range' ) {
162177 const selectedStartDay = areDatesOnSameDay ( day , startDate )
163178 const selectedEndDay = areDatesOnSameDay ( day , endDate )
@@ -237,7 +252,7 @@ function Month(props: MonthSingleProps | MonthRangeProps | MonthMultiProps) {
237252 endUnix : validRangeEnd ,
238253 } )
239254
240- if ( inRange ) {
255+ if ( inRange && ! inDisabledDates ) {
241256 disabled = false
242257 }
243258
@@ -273,6 +288,7 @@ function Month(props: MonthSingleProps | MonthRangeProps | MonthMultiProps) {
273288 dates ,
274289 validRangeStart ,
275290 validRangeEnd ,
291+ validDisabledDates ,
276292 mode ,
277293 ] )
278294
0 commit comments