@@ -73,8 +73,7 @@ const getMinMax = () => {
73
73
return { minDate, maxDate } ;
74
74
} ;
75
75
76
- const getMapDatesOpts = ( date : Date , timezone : TimeZoneConfig ) => {
77
- const highlightFn = ( date : any ) => ! ! date ;
76
+ const getMapDatesOpts = ( date : Date , timezone : TimeZoneConfig , highlightFn : ( date : any ) => boolean ) => {
78
77
return {
79
78
minDate : date ,
80
79
maxDate : date ,
@@ -448,7 +447,9 @@ describe('Utils and date utils formatting', () => {
448
447
it ( 'Should map propDates value with and without timezone' , async ( ) => {
449
448
const today = resetDateTime ( new Date ( ) ) ;
450
449
const highlightFn = ( date : any ) => ! ! date ;
451
- const mappedDates = mapPropDates ( getMapDatesOpts ( today , { timezone : undefined , exactMatch : false } ) ) ;
450
+ const mappedDates = mapPropDates (
451
+ getMapDatesOpts ( today , { timezone : undefined , exactMatch : false } , highlightFn ) ,
452
+ ) ;
452
453
453
454
expect ( mappedDates . maxDate ) . toEqual ( today ) ;
454
455
expect ( mappedDates . minDate ) . toEqual ( today ) ;
@@ -457,7 +458,9 @@ describe('Utils and date utils formatting', () => {
457
458
expect ( mappedDates . highlight ) . toEqual ( highlightFn ) ;
458
459
459
460
const todayInTz = localToTz ( today , 'UTC' ) ;
460
- const mappedDatesInTimezone = mapPropDates ( getMapDatesOpts ( today , { timezone : 'UTC' , exactMatch : false } ) ) ;
461
+ const mappedDatesInTimezone = mapPropDates (
462
+ getMapDatesOpts ( today , { timezone : 'UTC' , exactMatch : false } , highlightFn ) ,
463
+ ) ;
461
464
462
465
expect ( mappedDatesInTimezone . maxDate ) . toEqual ( todayInTz ) ;
463
466
expect ( mappedDatesInTimezone . minDate ) . toEqual ( todayInTz ) ;
0 commit comments