Created
December 28, 2015 13:07
-
-
Save achillar/b1a0d8a124c9eeff3b3a to your computer and use it in GitHub Desktop.
Using jQuery Datepicker as a failback for input type="date" fields
This file contains hidden or 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 (jQuery('[type="date"]').prop('type') !== 'date') { | |
document.write(unescape('%3Clink href="' + bcm.web_design_path + '/css/bootstrap-datepicker/datepicker3.css" rel="stylesheet" type="text/css" /%3E')); | |
document.write(unescape('%3Cscript src="' + bcm.web_design_path + '/js/plugins/bootstrap-datepicker/bootstrap-datepicker.js"%3E%3C/script%3E')); | |
document.write(unescape('%3Cscript src="' + bcm.web_design_path + '/js/plugins/bootstrap-datepicker/locales/bootstrap-datepicker.es.js"%3E%3C/script%3E')); | |
jQuery(document).ready(function () { | |
jQuery('[type="date"]').datepicker({ | |
format: "yyyy-mm-dd", | |
todayBtn: true, | |
language: "es", | |
autoclose: true, | |
todayHighlight: true | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment