From fd791a15287462e60baccb3fdf34169d4bcbaf39 Mon Sep 17 00:00:00 2001 From: Cr3aHal0 Date: Wed, 7 Feb 2024 19:00:27 +0100 Subject: [PATCH] feat: enable calendar to accept nullable input minDate & maxDate so that values can be reset if required --- src/app/components/calendar/calendar.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index ce28618cce4..309860302e6 100755 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -732,10 +732,10 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor { * The minimum selectable date. * @group Props */ - @Input() get minDate(): Date { + @Input() get minDate(): Date | undefined | null { return this._minDate; } - set minDate(date: Date) { + set minDate(date: Date | undefined | null) { this._minDate = date; if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) { @@ -746,10 +746,10 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor { * The maximum selectable date. * @group Props */ - @Input() get maxDate(): Date { + @Input() get maxDate(): Date | undefined | null { return this._maxDate; } - set maxDate(date: Date) { + set maxDate(date: Date | undefined | null) { this._maxDate = date; if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) { @@ -1039,9 +1039,9 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor { inputFieldValue: Nullable = null; - _minDate!: Date; + _minDate?: Date | null; - _maxDate!: Date; + _maxDate?: Date | null; _showTime!: boolean;