Unfortunately, this is not what the datepicker plugin is capable of doing out of the box. To do this, you will need special JavaScript.
I found a way that comes close to what you want using the onSelect and beforeShowDay . It supports its own array of selected dates, so, unfortunately, it does not integrate with a text field displaying the current date, etc. I just use it as an inline control, and then I can query the array for the currently selected dates.
The only thing you need to change about this code is to group every two dates into ranges, but there are several ways to do this depending on your desired UX. Personally, I would simply group every two dates as a range in the order in which the user selects. Then, if they remove the date from any range, the entire range is deleted (this is not encoded here, you need to add this).
Here is my code:
<script> </script>
And here is the fiddle: http://jsfiddle.net/gydL0epa/
source share