Skip to content

Instantly share code, notes, and snippets.

@gterrill
Created February 17, 2013 00:39
Show Gist options
  • Save gterrill/4969456 to your computer and use it in GitHub Desktop.
Save gterrill/4969456 to your computer and use it in GitHub Desktop.
Do something when a date is selected, preserving BookThatApp's handling for availability purposes
<script type="text/javascript">
bta_callbacks = {};
// invoked after availability data from BookThatApp is loaded via Ajax.
bta_callbacks["loaded"] = function(data) {
var onStartSelect = $('#booking-start').datepicker('option', 'onSelect'),
onFinishSelect = $('#booking-finish').datepicker('option', 'onSelect');
$('#booking-start').datepicker('option', 'onSelect', function(date) {
onStartSelect.call(this, date);
});
$('#booking-finish').datepicker('option', 'onSelect', function(date) {
onFinishSelect.call(this, date);
});
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment