angular_components
angular_components copied to clipboard
The calendar doesn't automatically scroll to the current day
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()); }
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())); }