We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When minDate is passed as prop, for example 2022-10-1 and date selection is clicked, 2022 year calendar can not be opened by clicking on 2022 year
code example
() => { const [showMonthYearPicker, setShowMonthYearPicker] = useState(false); const [showYearPicker, setShowYearPicker] = useState(false); const [selected, setSelected] = useState(new Date()); const [openDate, setOpenDate] = useState(new Date()); const renderMonthContent = (month, shortMonth, longMonth, day) => { const fullYear = new Date(day).getFullYear(); const tooltipText = `Tooltip for month: ${longMonth} ${fullYear}`; return <span title={tooltipText}>{shortMonth}</span>; }; const handleChange = (date) => { setOpenDate(date) if(!showMonthYearPicker && !showYearPicker){ setSelected(date) return } if(showMonthYearPicker) { setShowYearPicker(false) setShowMonthYearPicker(false) return } if(showYearPicker) { setShowYearPicker(false) setShowMonthYearPicker(true) } } return ( <DatePicker selected={selected} inline openToDate={openDate} renderMonthContent={renderMonthContent} showMonthYearPicker={showMonthYearPicker} showYearPicker={showYearPicker} dateFormat="d/MM/yyyy" minDate={new Date(2022, 10, 1)} maxDate={new Date()} onChange={handleChange} renderCustomHeader={(props) => ( <div> <div> {!showMonthYearPicker && !showYearPicker && ( <button onClick={() => { setShowYearPicker(false) setShowMonthYearPicker(true) }} > {props.date.getMonth()} </button> )} <button onClick={() => { setShowYearPicker(true) setShowMonthYearPicker(false) }} > {props.date.getFullYear()} </button> </div> </div> )} /> ); };
how to reproduce
another way to reproduce
how it should work
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
When minDate is passed as prop, for example 2022-10-1 and date selection is clicked, 2022 year calendar can not be opened by clicking on 2022 year
code example
how to reproduce
after this step will be opened months of the year date was selected before
another way to reproduce
here again will be opened months of the year was selected in step 2
how it should work
The text was updated successfully, but these errors were encountered: