Default date range picker dates when cleared

I am able to set default start and end dates for the date range picker component.

My problem is that I want users to be able to clear out the components with the clear button but when you do so the start and end dates are set as NULL rather than the default dates. How is it possible to set up the date range picker so that clearing out the values resets it to the default values?

Hey @rgm!

One option is to use a separate component (e.g. button or link) to trigger a query that calls something like

dateRange1.setValue({start: "default_start_date", end: "default_end_date"});

You might also try setting up a change event handler that checks to see if either the start date or the end date are null and then sets them to the default if that is the case.

Do you think either could work in your case?

Yes, the event handler solution works perfectly. Thanks!