I have a jQuery datepicker script:
$(function() { $( \"#datepicker\" ).datepicker({ dateFormat: \"yyyy-mm-dd\" });
You could also add classes on the fly if input fields are dynamically generated, such as in Django templates.
Get input fields using #id and add a class
$(function() { $( "#datepicker1, #datepicker2" ).addClass('datepicker'); $( ".datepicker" ).datepicker({ dateFormat: "yy-mm-dd" }); });