SaturnTeam / saturn-datepicker

Angular Material Datepicker with range selection
MIT License
278 stars 110 forks source link

_matCalendarBody.selectedValue is not updated when selected changed when using <sat-calendar [rangeMode]="false"> #122

Open joeriddles opened 4 years ago

joeriddles commented 4 years ago

When using the <sat-calendar> by itself with [rangeMode]="false", clicking on dates does not update the selectedValue UI.

Current work around is using:

@ViewChild(SatCalendar, {static: false}) private satCalendar: SatCalendar<Date>;
...
selectedChanged(event: Date): void {
    this.satCalendar.monthView._matCalendarBody.selectedValue = event.getDate();
}
SaturnTeam commented 4 years ago

@joeriddles I think you can easily find a reason for it in my code. Please try and make a pull request