问题
I am using Angular8+ and Jquery to open a calendar. I have used bootstrap datetimepicker to open the calendar. Now i have opened calendar and selected a date. And now i delete the date filled in it and open calendar, it opens the calendar with the previously selected month and year of calendar instead of opening to present date. Kindly help me to solve this.
DEMO:DEMO
TS:
ngAfterViewInit() {
$(".effectiveDate")
.datetimepicker({ format: "L", useCurrent: false })
.on("dp.change", e => {
if (e.date) {
const date = e.date.format("L");
this.date = date;
} else {
this.date = null;
}
});
}
Issue is: Now i choosed 09/09/2009 and i have cleared it, when i again click on Add and click on input it shows me calendar of september 2009, instead of showing current date, month and year.
来源:https://stackoverflow.com/questions/62344663/how-to-open-calendar-to-todays-date-if-there-is-no-date-present-in-input-field-u