I have several or a unknown amount of jQuery Date selectors on a view. Each date picker appears in a set order. I’d like to ensure that the user can only select a date which is 24 hours after the previous selection. So if there are 4 date pickers, the first one would be limited to selection from today onwards, the second from this time tomorrow onwards, the third this time on Wednesday and the fourth this time on Thursday.
Any ideas how to achieve this?
I’ve using a class to call the jQuery for each date picker as I don’t necessarily know the amount or id’s of the date pickers that will be on the page.
$(".publication_date").livequery(function() {
$(this).datepicker({
dateFormat: "dd M yy",
changeYear: true,
changeMonth: true,
altFormat: 'yy-mm-dd',
altField: $(this).next(),
minDate: new Date(),
onSelect: function(dateText, inst) {
}
});
});
Can you use the onSelect call back on each datepicker to use set the minDate on the next datepicker?