I have some questions regarding jQuery UI date picker.
1 - Is there an option to have a default value? What I am trying to do is pre-filled my input text type with today's date.
2 - If I put the type = "Date" instead of type = "Text" and then use jquery time picker on it, I get this error when I select the date.
The specified value '02/18/2015' does not conform to the required format, 'yyyy-MM-dd.'
How do I solve this?
To create the date picker and set the date. You can assign today's date by 'new Date().' You can set input
type=text
ortype=date
.
$('.datepicker').datepicker({
dateFormat: 'dd-mm-yy'
}).datepicker("setDate", new Date());
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