1- import React , { useState } from 'react '
1+ import { differenceInDays , isAfter , isBefore , isSameDay , startOfDay , startOfMonth } from 'date-fns '
22import { bool , func , instanceOf , number , object , objectOf , oneOf , string } from 'prop-types'
3- import { differenceInDays , isSameDay , isAfter , isBefore , startOfMonth , startOfDay } from 'date-fns'
4- import { isRangeLengthValid , isSelectable , mergeModifiers , setTime } from './utils'
5- import { START_DATE , END_DATE } from './constants'
6- import useControllableState from './useControllableState'
3+ import React , { useState } from 'react'
74import Calendar from './Calendar'
5+ import { END_DATE , START_DATE } from './constants'
6+ import useControllableState from './useControllableState'
7+ import { isRangeLengthValid , isSelectable , mergeModifiers , setTime } from './utils'
88
99export default function DateRangePickerCalendar ( {
1010 locale,
1111 startDate,
1212 endDate,
1313 focus,
1414 month : receivedMonth ,
15- onStartDateChange,
16- onEndDateChange,
17- onFocusChange,
15+ onStartDateChange = ( ) => { } ,
16+ onEndDateChange = ( ) => { } ,
17+ onFocusChange = ( ) => { } ,
1818 onMonthChange,
1919 minimumDate,
2020 maximumDate,
21- minimumLength,
22- maximumLength,
21+ minimumLength = 0 ,
22+ maximumLength = null ,
2323 modifiers : receivedModifiers ,
2424 modifiersClassNames,
2525 weekdayFormat,
@@ -118,9 +118,9 @@ DateRangePickerCalendar.propTypes = {
118118 endDate : instanceOf ( Date ) ,
119119 focus : oneOf ( [ START_DATE , END_DATE ] ) ,
120120 month : instanceOf ( Date ) ,
121- onStartDateChange : func . isRequired ,
122- onEndDateChange : func . isRequired ,
123- onFocusChange : func . isRequired ,
121+ onStartDateChange : func ,
122+ onEndDateChange : func ,
123+ onFocusChange : func ,
124124 onMonthChange : func ,
125125 minimumDate : instanceOf ( Date ) ,
126126 maximumDate : instanceOf ( Date ) ,
@@ -131,11 +131,3 @@ DateRangePickerCalendar.propTypes = {
131131 weekdayFormat : string ,
132132 touchDragEnabled : bool
133133}
134-
135- DateRangePickerCalendar . defaultProps = {
136- onStartDateChange : ( ) => { } ,
137- onEndDateChange : ( ) => { } ,
138- onFocusChange : ( ) => { } ,
139- minimumLength : 0 ,
140- maximumLength : null
141- }
0 commit comments