Skip to content

Commit

Permalink
fix(geo): check manual value for mat-autocomplete and mat-datepicker (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aziz-access authored Dec 6, 2023
1 parent 52d7ace commit 3a05ebf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ export class OgcFilterFormComponent implements OnInit {
.replace(/[\u0300-\u036f]/g, ''),
'gi'
);
return this.selectedField$.value.values.filter(

return this.selectedField$.value?.values?.filter(
(val) =>
val &&
keywordRegex.test(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ export class OgcFilterTimeComponent implements OnInit {
}

changeTemporalProperty(value, position?, refreshFilter = true) {
if (!this.isValidDate(value)) {
return;
}
let valueTmp = this.getDateTime(value, position);
if (this.isCalendarYearMode()) {
let dateStringFromYearNotime;
Expand Down Expand Up @@ -743,4 +746,8 @@ export class OgcFilterTimeComponent implements OnInit {
this.setFilterStateDisable();
this.updateValues();
}

private isValidDate(date: Date) {
return date instanceof Date && !isNaN(date.getTime());
}
}

0 comments on commit 3a05ebf

Please sign in to comment.