@@ -259,15 +259,33 @@ export abstract class BaseCalendarComponent<D, P> extends React.Component<BaseCa
259
259
} ;
260
260
261
261
public isDayDisabled = ( date : CalendarDateInfo < D > ) : boolean => {
262
- return ! this . isDateFitsBounds ( date ) || this . isDateFitsFilter ( date ) ;
262
+ const minDayStart : D = this . dateService . createDate (
263
+ this . dateService . getYear ( this . min ) ,
264
+ this . dateService . getMonth ( this . min ) ,
265
+ this . dateService . getDate ( this . min ) ,
266
+ ) ;
267
+
268
+ const maxDayStart : D = this . dateService . createDate (
269
+ this . dateService . getYear ( this . max ) ,
270
+ this . dateService . getMonth ( this . max ) ,
271
+ this . dateService . getDate ( this . max ) ,
272
+ ) ;
273
+
274
+ return ! this . dateService . isBetweenIncludingSafe ( date . date , minDayStart , maxDayStart ) || this . isDateFitsFilter ( date ) ;
263
275
} ;
264
276
265
277
private isMonthDisabled = ( date : CalendarDateInfo < D > ) : boolean => {
266
- return ! this . isDateFitsBounds ( date ) || this . isDateFitsFilter ( date ) ;
278
+ const minMonthStart : D = this . dateService . getMonthStart ( this . min ) ;
279
+ const maxMonthStart : D = this . dateService . getMonthStart ( this . max ) ;
280
+
281
+ return ! this . dateService . isBetweenIncludingSafe ( date . date , minMonthStart , maxMonthStart ) ;
267
282
} ;
268
283
269
284
private isYearDisabled = ( date : CalendarDateInfo < D > ) : boolean => {
270
- return ! this . isDateFitsBounds ( date ) || this . isDateFitsFilter ( date ) ;
285
+ const minYearStart : D = this . dateService . getYearStart ( this . min ) ;
286
+ const maxYearStart : D = this . dateService . getYearEnd ( this . max ) ;
287
+
288
+ return ! this . dateService . isBetweenIncludingSafe ( date . date , minYearStart , maxYearStart ) ;
271
289
} ;
272
290
273
291
public isDayToday = ( date : CalendarDateInfo < D > ) : boolean => {
0 commit comments