uvarov-frontend / vanilla-calendar-pro

The Vanilla Calendar Pro is a versatile JavaScript date and time picker component with TypeScript support, making it compatible with any JavaScript frameworks and libraries. It is designed to be lightweight, easy to use, and feature-rich, without relying on external dependencies.
https://vanilla-calendar.pro
MIT License
456 stars 58 forks source link

Dynamically Updating Disabled Dates #315

Open ioannis-psomadelis opened 2 hours ago

ioannis-psomadelis commented 2 hours ago

On the initial load(calendar init), when I pass unavailableDates into the range options, the calendar works perfectly. However, when navigating between months (using the navigation arrows), I try to update the disabled dates dynamically, but I'm not seeing any changes reflected in the DOM/calendar.

the first init const options = { range: { disabled: this.unavailableDates, }, }, ...

after patching self.actions.updateUnavailableDates(self, newPrices); //custom function to pass the dates into the unavailableDates self.update({dates: false,});

The new data is successfully added to the settings object, but it doesn't seem to reflect in the calendar.

uvarov-frontend commented 2 hours ago

Hi, thanks for reporting the issue, I'll take a look and let you know.

uvarov-frontend commented 1 hour ago

You can get a faster answer if you recreate the problem in any js sandbox. For example here: https://codesandbox.io