Custom onChange function to react-date-picker

I'm trying to use shad's custom date range picker and add it to a form. but i can't seem to pass a custom onChange function to react-date-picker...
No description
3 Replies
Coded_58
Coded_58OP16mo ago
No description
Gabriel
Gabriel16mo ago
Hi @Coded_58 , Calendar has a onSelect prop that you can use. It takes in a function with Date | undefined and you can use it to trigger whaterver else EG:
<Calendar
mode="single"
selected={from.toDate()}
onSelect={(date) => {
alert(date?.toISOString())
);
}}
/>
<Calendar
mode="single"
selected={from.toDate()}
onSelect={(date) => {
alert(date?.toISOString())
);
}}
/>
Coded_58
Coded_58OP16mo ago
thanks man...
Want results from more Discord servers?
Add your server