Is it possible to deselect the current date in jQuery UI datepicker?

I use datepicker, which is always displayed on the page and attached to a hidden <input> . Depending on the user interactions on the page, some dates may be dynamically disabled (via beforeShowDay ).

The problem is that this allows you to disable the date that was previously selected:

enter image description here

To avoid this, I would like to deselect the current date before updating the datepicker.

Is it possible?

+4
source share
1 answer

EDIT: Datpicker attached to div . Clear the selected value as follows:

 $('selector').datepicker('setDate') 

This will cancel the choice of any day.

+4
source

Source: https://habr.com/ru/post/1432238/


All Articles