wakirin / Litepicker

Date range picker - lightweight, no dependencies
MIT License
899 stars 132 forks source link

Update multiselect plugin with option to deselect/select programatically #231

Open tobimori opened 3 years ago

tobimori commented 3 years ago

Is your feature request related to a problem? Please describe. In a recent client project I worked with dynamic locking and unselecting dates if other filter options doesn't offer any results on that date.

Describe the solution you'd like Litepicker Event to simply unselect/select dates programatically that without manually recreating the plugin's code.

Describe alternatives you've considered Using the following code for deselecting with automatic apply/inline mode:

picker.preMultipleDates = picker.preMultipleDates.filter(x => x !== renderedDate.getTime());
picker.emit('button:apply', renderedDate)
day.classList.remove('is-selected')

Additional context I'm planning to submit a PR for this soon.