Skip to content

Commit

Permalink
feat: enable calendar to accept nullable input minDate & maxDate so t…
Browse files Browse the repository at this point in the history
…hat values can be reset if required
  • Loading branch information
Cr3aHal0 committed Feb 8, 2024
1 parent 4e6110e commit fd791a1
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 | 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) {
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 | 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) {
Expand Down Expand Up @@ -1039,9 +1039,9 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {

inputFieldValue: Nullable<string> = null;

_minDate!: Date;
_minDate?: Date | null;

_maxDate!: Date;
_maxDate?: Date | null;

_showTime!: boolean;

Expand Down

0 comments on commit fd791a1

Please sign in to comment.