diff --git a/utils/rangeFilter/rangeFilter.component.ts b/utils/rangeFilter/rangeFilter.component.ts index dcf0d9a3..3c7e5e48 100644 --- a/utils/rangeFilter/rangeFilter.component.ts +++ b/utils/rangeFilter/rangeFilter.component.ts @@ -21,7 +21,7 @@ export class RangeFilterComponent { @Input() yearMax: number = Dates.yearMax; @Input() mandatoryRange:boolean = false; public currentYear: number = Dates.currentYear; - public yearValidators = [StringUtils.inValidYearValidator(this.yearMin, this.yearMax)]; + public yearValidators; public formValidators = [StringUtils.fromYearAfterToYearValidator]; public rangeForm: UntypedFormGroup; public yearRange: YearRange = { @@ -41,6 +41,11 @@ export class RangeFilterComponent { constructor(private _router: Router, private route: ActivatedRoute, private _fb: UntypedFormBuilder) {} ngOnInit() { + this.yearValidators = [StringUtils.inValidYearValidator(this.yearMin, this.yearMax)]; + this.yearRange = { + from: {control: 'yearFrom', placeholder: this.yearMin.toString()}, + to: {control: 'yearTo', placeholder: this.yearMax.toString()} + } if(this.mandatoryRange) { this.formValidators.push(StringUtils.rangeRequired(this.mandatoryRange)); }