Select multiple dates one by one using jQuery / Datepicker

I have a form, and in this form I would like to have a dumper. Therefore, when someone presses the button for selecting the date field, the date picker pops up and shows several months. From there, I would like the person to click on individual dates, each click on the date they selected is added to the comma section of the form field. I am looking for a jquery solution, right now Im looking at:

http://jqueryui.com/demos/datepicker/#multiple-calendars

The problem is that when I select the date when the datepicker closes, then the selected date is displayed in the form field. I want the datepicker to keep showing until they select multiple dates, and the dates they have selected remain highlighted, and then click the button when they are done, selecting the dates. Can someone tell me how can I do this, or is there already existing jquery code?

+4
source share
2 answers

try this plugin (demo at the bottom of the page): http://multidatespickr.sourceforge.net/

+2
source

For those who have landed here, trying to select multiple dates to highlight selected dates - you can use the beforeshowday event to add a class.

NB: this will add a class to everything that was not selected, which means that you can easily customize it and use regular classes for the selected style.

$( '#booking_date' ).multiDatesPicker({ beforeShowDay: function(date) { return [true, 'myClass']; } }); 
0
source

All Articles