diff --git a/libs/perun/dialogs/src/lib/expiration-select/expiration-select.component.ts b/libs/perun/dialogs/src/lib/expiration-select/expiration-select.component.ts index 3307ad24f..b778c6234 100644 --- a/libs/perun/dialogs/src/lib/expiration-select/expiration-select.component.ts +++ b/libs/perun/dialogs/src/lib/expiration-select/expiration-select.component.ts @@ -25,9 +25,9 @@ export class ExpirationSelectComponent implements OnInit, OnChanges { // Change selected date to be in [min, max] range const selectedExpiration = new Date(this.expirationControl.value); let validExpiration = selectedExpiration; - if (selectedExpiration < this.minDate) { + if (this.minDate && selectedExpiration < this.minDate) { validExpiration = this.minDate; - } else if (selectedExpiration > this.maxDate) { + } else if (this.maxDate && selectedExpiration > this.maxDate) { validExpiration = this.maxDate; }