Skip to content

Commit

Permalink
fix(admin): fixed bug in expiration-select
Browse files Browse the repository at this point in the history
* fixed a bug where if no max/min date values were passed, the component returned null date

(cherry picked from commit d358470)
  • Loading branch information
xflord authored and HejdaJakub committed Apr 18, 2023
1 parent d950c24 commit d705eb0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d705eb0

Please sign in to comment.