Reputation: 1345
I have already initialized my jquery datepicker
with the format dd-M-yyyy
. On some particular event I want to set that datepicket with today's date
with the respective date format(dd-M-yyyy
) that already I have set. I tried these codes but none of them are working, help me..
html
<input id="SD_WO_DATE" readonly="readonly" type="text">
js
$("#SD_WO_DATE").datepicker().datepicker( "option", "defaultDate", new Date() );
and
$("#SD_WO_DATE").datepicker().datepicker("setDate", new Date());
These are setting date with mm-dd-yyyy
which I don't want.
Upvotes: 1
Views: 142