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.
From http://api.jqueryui.com/datepicker/#method-setDate :
$(".datepicker").datepicker("setDate", -1)
$( ".datepicker" ).datepicker({ defaultDate: -1 });
由http://docs.jquery.com/UI/Datepicker#option-defaultDate提供,这应该是诀窍
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.