);

};

return (

selected={startDate} onChange={date => setStartDate(date)} calendarContainer={MyContainer}

/>

);

};

GET RAW INPUT VALUE ON CHANGE

() => {

const  = useState(null); const handleChangeRaw = value => { if (value === "tomorrow") { setStartDate(addDays(new Date(), 1));

}

};

return (

selected={startDate} onChange={date => setStartDate(date)} placeholderText='Enter "tomorrow"' onChangeRaw={event => handleChangeRaw(event.target.value)}

/>

);

};

() => {

const  = useState(null); const handleChangeRaw = value => { if (value === "tomorrow") { setStartDate(addDays(new Date(), 1));

}

};

return (

selected={startDate} onChange={date => setStartDate(date)} placeholderText='Enter "tomorrow"' onChangeRaw={event => handleChangeRaw(event.target.value)}

/>

);

};

DON'T HIDE CALENDAR ON DATE SELECTION

() => {

const  = useState(new Date());

return (

selected={startDate} onChange={date => setStartDate(date)} shouldCloseOnSelect={false}

/>

);

};

() => {

const  = useState(new Date());

return (

selected={startDate} onChange={date => setStartDate(date)} shouldCloseOnSelect={false}

/>

);

};

CUSTOM HEADER

() => {

const  = useState(new Date()); const years = range(1990, getYear(new Date()) + 1, 1);

const months = ;

return (

renderCustomHeader={({

date,

changeYear,

changeMonth,

decreaseMonth,

increaseMonth,

prevMonthButtonDisabled, nextMonthButtonDisabled

}) => (

style={{

margin: 10,

display: "flex",

justifyContent: "center"

}}

>

{"<"}

value={getYear(date)} onChange={({ target: { value } }) => changeYear(value)}

>

{years.map(option => (

{option}

))}

value={months}

onChange={({ target: { value } }) => changeMonth(months.indexOf(value))

}

>

{months.map(option => (

{option}

))}

{">"}

)}

selected={startDate} onChange={date => setStartDate(date)}

/>

);

};

() => {

const  = useState(new Date()); const years = range(1990, getYear(new Date()) + 1, 1);

const months = ;

return (

renderCustomHeader={({

date,

changeYear,

changeMonth,

decreaseMonth,

increaseMonth,

prevMonthButtonDisabled, nextMonthButtonDisabled

}) => (

style={{

margin: 10,

display: "flex",

justifyContent: "center"

}}

>

{"<"}

value={getYear(date)} onChange={({ target: { value } }) => changeYear(value)}

>

{years.map(option => (

{option}

))}

value={months}

onChange={({ target: { value } }) => changeMonth(months.indexOf(value))

}

>

{months.map(option => (

{option}

))}

{">"}

)}

selected={startDate} onChange={date => setStartDate(date)}

/>

);

};

CUSTOM DAY

() => {

const  = useState(new Date()); const renderDayContents = (day, date) => { const tooltipText = `Tooltip for date: ${date}`; return {getDate(date)};

};

return (

selected={startDate} onChange={date => setStartDate(date)} renderDayContents={renderDayContents}

/>

);

};

() => {

const  = useState(new Date()); const renderDayContents = (day, date) => { const tooltipText = `Tooltip for date: ${date}`; return {getDate(date)};

};

return (

selected={startDate} onChange={date => setStartDate(date)} renderDayContents={renderDayContents}

/>

);

};

INPUT TIME

() => {

const  = useState(new Date());

return (

selected={startDate} onChange={date => setStartDate(date)} timeInputLabel="Time:" dateFormat="MM/dd/yyyy h:mm aa"

showTimeInput

/>

);

};

() => {

const  = useState(new Date());

return (

selected={startDate} onChange={date => setStartDate(date)} timeInputLabel="Time:" dateFormat="MM/dd/yyyy h:mm aa"

showTimeInput

/>

);

};

STRICT PARSING

() => {

const  = useState(new Date());

return (

selected={startDate} onChange={date => setStartDate(date)}

strictParsing

/>

);

};

() => {

const  = useState(new Date());

return (

selected={startDate} onChange={date => setStartDate(date)}

strictParsing

/>

);

};

MONTH PICKER

() => {

const  = useState(new Date());

return (

selected={startDate} onChange={date => setStartDate(date)} dateFormat="MM/yyyy"

showMonthYearPicker

/>

);

};

() => {

const  = useState(new Date());

return (

selected={startDate} onChange={date => setStartDate(date)} dateFormat="MM/yyyy"

showMonthYearPicker

/>

);

};

RANGE MONTH PICKER

() => {

const  = useState(new Date("2014/02/08")); const  = useState(new Date("2014/04/08"));

return (

<>

selected={startDate} onChange={date => setStartDate(date)}

selectsStart

startDate={startDate}

endDate={endDate}

dateFormat="MM/yyyy"

showMonthYearPicker

/>

selected={endDate}

onChange={date => setEndDate(date)}

selectsEnd

startDate={startDate}

endDate={endDate}

dateFormat="MM/yyyy"

showMonthYearPicker

/>

);

};

() => {

const  = useState(new Date("2014/02/08")); const  = useState(new Date("2014/04/08"));

return (

<>

selected={startDate} onChange={date => setStartDate(date)}

selectsStart

startDate={startDate}

endDate={endDate}

dateFormat="MM/yyyy"

showMonthYearPicker

/>

selected={endDate}

onChange={date => setEndDate(date)}

selectsEnd

startDate={startDate}

endDate={endDate}

dateFormat="MM/yyyy"

showMonthYearPicker

/>

);

};

QUARTER PICKER

() => {

const  = useState(new Date());

return (

selected={startDate} onChange={date => setStartDate(date)} dateFormat="yyyy, QQQ" showQuarterYearPicker

/>

);

};

() => {

const  = useState(new Date());

return (

selected={startDate} onChange={date => setStartDate(date)} dateFormat="yyyy, QQQ" showQuarterYearPicker

/>

);

};

RANGE QUARTER PICKER

() => {

const  = useState(new Date("2014/02/08")); const  = useState(new Date("2014/07/08"));

return (

<>

selected={startDate} onChange={date => setStartDate(date)}

selectsStart

startDate={startDate}

endDate={endDate}

dateFormat="yyyy, QQQ" showQuarterYearPicker

/>

selected={endDate}

onChange={date => setEndDate(date)}

selectsEnd

startDate={startDate}

endDate={endDate}

dateFormat="yyyy, QQQ" showQuarterYearPicker

/>

);

};

() => {

const  = useState(new Date("2014/02/08")); const  = useState(new Date("2014/07/08"));

return (

<>

selected={startDate} onChange={date => setStartDate(date)}

selectsStart

startDate={startDate}

endDate={endDate}

dateFormat="yyyy, QQQ" showQuarterYearPicker

/>

selected={endDate}

onChange={date => setEndDate(date)}

selectsEnd

startDate={startDate}

endDate={endDate}

dateFormat="yyyy, QQQ" showQuarterYearPicker

/>

);

};

CALENDAR OPEN STATE CALLBACKS

() => {

const  = useState(new Date()); const handleCalendarClose = () => console.log("Calendar closed"); const handleCalendarOpen = () => console.log("Calendar opened");

return (

selected={date}

onChange={date => setDate(date)} onCalendarClose={handleCalendarClose} onCalendarOpen={handleCalendarOpen}

/>

);

};

() => {

const  = useState(new Date()); const handleCalendarClose = () => console.log("Calendar closed"); const handleCalendarOpen = () => console.log("Calendar opened");

return (

selected={date}

onChange={date => setDate(date)} onCalendarClose={handleCalendarClose} onCalendarOpen={handleCalendarOpen}

/>

);

};

CUSTOM TIME INPUT

() => {

const  = useState(new Date()); const ExampleCustomTimeInput = ({ value, onChange }) => (

value={value}

onChange={e => onChange(e.target.value)} style={{ border: "solid 1px pink" }}

/>

);

return (

selected={startDate} onChange={date => setStartDate(date)}

showTimeInput

customTimeInput={}

/>

);

};

() => {

const  = useState(new Date()); const ExampleCustomTimeInput = ({ value, onChange }) => (

value={value}

onChange={e => onChange(e.target.value)} style={{ border: "solid 1px pink" }}

/>

);

return (

selected={startDate} onChange={date => setStartDate(date)}

showTimeInput

customTimeInput={}

/>

);

};

Details

6