Skip to content

Commit d705eb0

Browse files
xflordHejdaJakub
authored andcommitted
fix(admin): fixed bug in expiration-select
* fixed a bug where if no max/min date values were passed, the component returned null date (cherry picked from commit d358470)
1 parent d950c24 commit d705eb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/perun/dialogs/src/lib/expiration-select/expiration-select.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export class ExpirationSelectComponent implements OnInit, OnChanges {
2525
// Change selected date to be in [min, max] range
2626
const selectedExpiration = new Date(this.expirationControl.value);
2727
let validExpiration = selectedExpiration;
28-
if (selectedExpiration < this.minDate) {
28+
if (this.minDate && selectedExpiration < this.minDate) {
2929
validExpiration = this.minDate;
30-
} else if (selectedExpiration > this.maxDate) {
30+
} else if (this.maxDate && selectedExpiration > this.maxDate) {
3131
validExpiration = this.maxDate;
3232
}
3333

0 commit comments

Comments
 (0)