Open GustavoSD opened 3 years ago
Have you found an answer for this?
Have you found an answer for this? Nope, not a solution for this. I had to change to another library.
You can figure out which date (start or end date) is "focused" by using the focusedRange
.
In the onChange
handler you can then use this information to check which date was set.
Maybe this helps: https://codesandbox.io/s/red-morning-jrdd2?file=/src/Picker.js
This doesn't work when selecting a predefined range... any additional suggestions for that scenario?
add hasCustomRendering
as true
in your staticRanges
then add some trigger event in renderStaticRangeLabel
<DateRangePicker
.....
renderStaticRangeLabel={(range) => (
<div
onClick={() => {
// add your custom function here
}}
>
{range.label}
</div>
)}
staticRanges={[
label: 'Last 30 days',
hasCustomRendering: true,
range: () => ({
startDate: ...,
endDate: ...,
})
]}
/>
Subject of the issue
There's a way I can trigger a function when selecting the end date?