Skip to content

Instantly share code, notes, and snippets.

@ryanurban
Created July 24, 2013 18:41
Show Gist options
  • Save ryanurban/6073260 to your computer and use it in GitHub Desktop.
Save ryanurban/6073260 to your computer and use it in GitHub Desktop.
// Customize Events Community Datepicker
if($("div.tribe-community-events-date input.datepicker").length) {
var datepickerOpts = {
dateFormat: 'yy-mm-dd',
changeMonth: true,
changeYear: true,
onSelect: function(selectedDate) {
var option = this.id == "EventStartDate" ? "minDate" : "maxDate";
var instance = $(this).data("datepicker");
var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
dates.not(this).not('#recurrence_end').datepicker("option", option, date);
}
}
var dates = $("div.tribe-community-events-date input.custom-datepicker").datepicker(datepickerOpts);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment