I am using Bootstrap-Datepicker. I would like to get today's date, minus 10 years from today's date, then show "(today's year-10)/1/1" as default display value, before the picker is displayed.
Right now, my code is as below. It shows "1990-1-1" as default.
$(".datepicker").datepicker({
// omitted
}).datepicker("setDate", "1990-1-1");
});
I can get today's date to show with the code below, but I can not get it to calculate minus 10 years. How do I do so?
}).datepicker("setDate", new Date());
FYI: This is the default date that needs to be shown:
Today's year - 10 / January / 1st