The calendar doesn't automatically scroll to the current day
salojoo opened this issue · 1 comments
salojoo commented
MaterialCalendarPickerComponent opens to minDate by default, instead of scrolling to today
As a work-around one can reference the component with ViewChild, and scroll in OnInit()
@ViewChild(MaterialCalendarPickerComponent) MaterialCalendarPickerComponent calendarPickerComponent;
ngOnInit() async {
calendarPickerComponent.scrollToDate(Date.today());
}
salojoo commented
My work-around maybe only works, because I have some async code for delay in the onInit function
So a better solution would be to use a timer
ngOnInit() {
Timer.run(() => calendarPickerComponent.scrollToDate(Date.today()));
}