How to disable calendar dates selection based on a condition in JavaScript | XM Community
Skip to main content

I have a survery question that allows users to select a date from a calendar dropdown.
How to disable a specific date based on a condition in JavaScript? If the number of responses on a specific day is met the Threshold (Ex: 100), the user should not be allowed to select the date (disable date selection).
Current code for ex:
"disable": ["2022-08-15", function(date){return (date.getDay() === 0 || date.getDay() ===6 );}],"locale": {"firstDayOfWeek": 0}

With the existing code, how do we modify or add the new use case.

Be the first to reply!

Leave a Reply