Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions projects/datetime-picker/src/lib/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@switch (currentView()) {
@case ('month') {
<ngx-mat-month-view
[(activeDate)!]="activeDate"
[activeDate]="activeDate"
[selected]="selected"
[dateFilter]="dateFilter()"
[maxDate]="maxDate"
Expand All @@ -21,7 +21,7 @@
}
@case ('year') {
<ngx-mat-year-view
[(activeDate)!]="activeDate"
[activeDate]="activeDate"
[selected]="selected"
[dateFilter]="dateFilter()"
[maxDate]="maxDate"
Expand All @@ -32,7 +32,7 @@
}
@case ('multi-year') {
<ngx-mat-multi-year-view
[(activeDate)!]="activeDate"
[activeDate]="activeDate"
[selected]="selected"
[dateFilter]="dateFilter()"
[maxDate]="maxDate"
Expand Down
4 changes: 2 additions & 2 deletions projects/datetime-picker/src/lib/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ export class NgxMatCalendar<D> implements AfterContentInit, AfterViewChecked, On
* The current active date. This determines which time period is shown and which date is
* highlighted when using keyboard navigation.
*/
get activeDate(): D | null {
return this._clampedActiveDate;
get activeDate(): D {
return this._clampedActiveDate ?? this._dateAdapter.today();
}
set activeDate(value: D) {
this._clampedActiveDate = this._dateAdapter.clampDate(value, this.minDate, this.maxDate);
Expand Down