Setting Yesterday to Jquery datepicker
问题 I am trying to set yesterdays day to a Jquery datapicker as follows: $(".datepicker").datepicker("setDate", (new Date().getDate() - 1) ); However, I am always getting todays date. The code is located in $(document).ready and it does get excuted, cause if I comment out the line abobve, no value shows up. Could anyone point out what I am doing wrong. 回答1: From http://api.jqueryui.com/datepicker/#method-setDate: $(".datepicker").datepicker("setDate", -1) Demo 回答2: $( ".datepicker" ).datepicker({