javascript

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.

$("#dateId").datepicker({
    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?