Skip to content

Commit

Permalink
feat(calendar): enable calendar to accept nullable input minDate & ma…
Browse files Browse the repository at this point in the history
…xDate so that values can be reset if required
  • Loading branch information
Cr3aHal0 committed Feb 7, 2024
1 parent ee3f8d5 commit 74a5580
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
return this._minDate;
}
set minDate(date: Date) {
set minDate(date: Date | undefined) {
this._minDate = date;

if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {
Expand All @@ -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 {
return this._maxDate;
}
set maxDate(date: Date) {
set maxDate(date: Date | undefined) {
this._maxDate = date;

if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {
Expand Down Expand Up @@ -1039,9 +1039,9 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {

inputFieldValue: Nullable<string> = null;

_minDate!: Date;
_minDate?: Date;

_maxDate!: Date;
_maxDate?: Date;

_showTime!: boolean;

Expand Down

0 comments on commit 74a5580

Please sign in to comment.