Search code snippets, questions, articles...

Set default date in Jquery UI datepicker

Jquery UI datepicker provides a 'defaultDate' property when creating. This can be used to set a default date.
    defaultDate: '03/28/2020'

You can also set a date in the Jquery UI date picker by using "setDate". Below is the example

$("#dateId").datepicker("setDate", "03/28/2020");

Always remember to pass the date in the exact format that you are using

Was this helpful?
Programming Feeds
Learn something new everyday on Devsheet