Need a special offer?Find out if your project fits.
+

set calendar component's max / min date

Answered
Menachem asked on April 21, 2024

i'm trying to disable future / earlier than 3 years date selections for the date fields filters.
is there any way i can achieve that?

something like:

"timestamp": {
"type": "date string",
"mindate": DATE,
"maxdate": DATE
}

Thanks.

1 answer

Public
Maksym Diachenko Maksym Diachenko Flexmonster April 22, 2024

Hello, Menachem!

Thank you for reaching out to us.

Kindly note that Flexmonster does not support disabling the selection of certain members from the filter UI. However, a similar result in limiting the date selection can be achieved by prefiltering the data before passing it to the component. This functionality can be implemented for the custom API data source by adding the date limit parameters to the customizeAPIRequest function. This way, you could send min and max dates to the custom API server and filter the data before returning it to the client. 
We have prepared a JSFiddle example to illustrate the idea: https://jsfiddle.net/flexmonster/94kthagx/

Please let us know if such an approach would work for you.

Best Regards,
Maksym

Please login or Register to Submit Answer