The plugin developed by @dubrox is very lightweight and works almost identical to jQuery UI. My requirement was to have the ability to restrict the number of dates selected.
Intuitively, the maxPicks
property seems to have been provided for this purpose, but it doesn't work unfortunately.
For those of you looking for this fix, here it is:
First up, you need to patch jquery.ui.multidatespicker.js
. I have submitted a pull request on github. You can use that until dubrox merges it with the master or comes up with a fix of his own.
Usage is really straightforward. The below code causes the date picker to not select any dates once the specified number of dates (maxPicks
) has been already selected. If you unselect any previously selected date, it will let you select again until you reach the limit once again.
$("#mydatefield").multiDatesPicker({maxPicks: 3});