Created
January 25, 2020 11:33
-
-
Save DuckDivers/468c1141355e3aae7424ee2f9eb5c869 to your computer and use it in GitHub Desktop.
jquery check if is function before executing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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