jQuery(document).ready(function () { if(jQuery(".datepicker").length > 0) { jQuery(".datepicker").datepicker({ dateFormat:"yy-mm-dd" }); } });