Hello!
I am working on a Reactive application and have been integrating the "Date Picker Range" component into a form where users need the flexibility to select either a single date or a date range. I've noticed that double-clicking on a day selects that day as a single date. However, when I try to submit the form after selecting just one date, I encounter an error message saying "enter a valid date." (which comes from the built-in validation errors and not from my custom validations)
Here are some specific questions and details about my scenario:
Any advice or insights on how to manage this configuration would be greatly appreciated. Thank you for your support and looking forward to your suggestions.
Hello @Andrea Caselli
To make this more collaborative and to make sure the community is looking into the same use case that you're reporting, please share a sample oml where that can be reproduced (include a GIF/video if it's easier to showcase the steps to reproduce) - this is particularly useful for 2) on your questions even because forms validation is something on the developer's side.
For 1) even though is not something tested or something that will be offered/supported out of the box, you can try to use extensibility to achieve that.For that in the initialize event handler of your date picker add the following JS node.
The problem is that the output of this component is prepared to return a single date so it won't work as expected. So you need to attach an event like the onchange (using SetFlatpickrEvent client action) or what suits better your use case from the one available at flatpickr.
Something like:
And that's it!
Notes:
Hope it helps.
Cheers,GM