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)
Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With