Skip to content

Instantly share code, notes, and snippets.

@DuckDivers
Created January 25, 2020 11:33
Show Gist options
  • Save DuckDivers/468c1141355e3aae7424ee2f9eb5c869 to your computer and use it in GitHub Desktop.
Save DuckDivers/468c1141355e3aae7424ee2f9eb5c869 to your computer and use it in GitHub Desktop.
jquery check if is function before executing
if ( $.isFunction($.fn.datepicker) ) {
$('input.datepicker').datepicker({
// The format you want
altFormat: "yy-mm-dd",
// The format the user actually sees
dateFormat: "M dd, yy",
changeYear: true,
changeMonth: true
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment