Reputation: 426
I´m trying to call two functions when closing the jQuery UI Datepicker, but I´m not sure what´s the best way to do this.
If I only have one function I can do this:
function splitArrivalDate() {
// Some code
}
$( '#mydatepicker' ).datepicker({
onClose: splitArrivalDate
});
But what if I want to call two functions sequentially on the onClose event?
function splitArrivalDate() {
// Some code
}
function setDepartureDate() {
// Some code
}
$( '#mydatepicker' ).datepicker({
onClose: splitArrivalDate; setDepartureDate // Does not work
});
I hope someone can help me understand this. Thanks!
Upvotes: 1
Views: 794
Reputation: 5515
You want something like this:
$( '#mydatepicker' ).datepicker({
onClose: function () { splitArrivalDate(); setDepartureDate(); }
});
Upvotes: 3