Skip to content

CaptionDropdowns don't visible #1932

Answered by gpbl
jullic asked this question in Support
Discussion options

You must be logged in to vote

Hi @jullic!

You need to set the fromYear and toYear props if you want the captionLayout prop to work:

export const DatePicker: FC<IDatePickerProps> = ({ className, ...props }) => {
	const [selectedDay, setSelectedDay] = useState<Date>();
	return (
		<div className={classNames(styles.root, className)} {...props}>
			<DayPicker
				mode='single'
				locale={ru}
				selected={selectedDay}
				onSelect={setSelectedDay}
- 				components={{
-					Caption: CaptionDropdowns,
-				}}
+				fromYear={2023}
+				toYear={2023}
+				captionLayout="dropdown"
			/>
		</div>
	);
};

E.g.: https://react-day-picker.js.org/basics/navigation#choosing-a-caption-layout

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gpbl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants