I need to find out the previous year date from current date and then set as minDate in jQuery UIdatepicker in javascript
My date formaqt is dd-mm-yy
you can define a new date or an existing date as d variable
var d = new Date();
then you can put date, month and year to the new date string using ${variableName}
,
Also you must add 1 to d.getMonth() and substract 1 from d.getFullYear()
var previousYearDate = `${d.getDate()}-${d.getMonth() + 1}-${d.getFullYear() - 1}`;