Props

This is a list of props that are available in React-Calendar-DateTime-Picker:

PropertyTypeRequiredDefaultDescription
onChangefunctrue-A function that returns an object of selected date/dates.
initValueDay | nullnullYou can set a default value for your date using this property.
typestringsingleYou can choose the selection type that you need to use. There exist 3 types: "single", "range", "multi"
localstringenThis date picker supports both Gregorian and Jalali calenders.To select Gregorian calendar you have to set "local" to "en" and to "fa" for Jalali.
autoClosebooleantrueCalendar modal close automatically, by set autoClose to false you can keep calender modal open even after selecting date(auto closing just works on single and range type)
withTimebooleanfalseShould you need to use time in your date picker you can set this prop to true.This prop works only in single and range types.
showTimeInputbooleanfalseHelps you to show time in input date picker
showWeekendbooleanfalseMarks weekends by changing the color.
clearBtnbooleanfalseAdd a button to your input to clear you calendar initial date/dates.
isRequiredbooleanfalseThis prop makes your input as a required field in the form validation
todayBtnbooleanfalseA button to move fast to the date of today in the calendar.
onCalenderChangefuncA callback that runs when the calendar value is changed, to use this feature you should pass initValue
onCalenderShowfuncA callback that runs when the calendar opens
onCalenderHidefuncA callback that runs when the calendar closes
maxDateDayYou can set this prop to limit the maximum date that the user can select.Periods partially overlapped by maxDate will also be selectable, although React-calendar-dateTime-picker will ensure that no later date is selected.
minDateDayYou can set this prop to limit the minimum date that the user can select. Periods partially overlapped by minDate will also be selectable, although React-calendar-dateTime-picker will ensure that no earlier date is selected.
disabledDatesDay[]A list of dates that you want the user not to select.
isDisabledbooleanfalseUse to disable the calendar input
inputIdstringAssign an id to calendar input
yearListStylestringgridUse to change year item list style(accepted value: grid, list)