I have the following code:
<input type="text" class="datepicker span8" name="targetDeliveryDate" id="targetDeliveryDate" field="targetDeliveryDate"
data-date-picker="true" data-date-future="true" data-date-format="dd-mm-yyyy" data-date-autoclose="true" value="dd-MM-yyyy">
I have been setting the date using the code below:
$("#targetDeliveryDate").value "01-12-2013"
Note that this is really static. However this is what the requirement was. But I'm expanding my tests and I need to set the date to the current active date.
I have looked at several posts but nothing works. I have tried the following but none of them work:
$("#targetDeliveryDate").val(new date());
$("#date_targetDeliveryDate").datepicker('setDate', new Date());
Please let me know if there is a way we can set the date to current date.
Having spent the whole evening trying to figure out the implementation, I have finally managed to resolve it and the code snippet is below:
And to set the value:
Thanks for the replies above.