From c99487babc2666f2db643bc7a45e48777372dbfd Mon Sep 17 00:00:00 2001 From: Alisa Ismailati Date: Mon, 30 Oct 2023 16:14:13 +0100 Subject: [PATCH] [DURACOM-194] fixed year input value on input type date (cherry picked from commit c412c1fa13b30ac5140259ff2542a60e8646382e) --- .../models/date-picker/date-picker.component.ts | 5 ++--- src/app/shared/form/number-picker/number-picker.component.ts | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts index 717aa88d44d..404e8514933 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts @@ -89,9 +89,8 @@ export class DsDatePickerComponent extends DynamicFormControlComponent implement } } - this.maxYear = this.initialYear + 100; - - } + this.maxYear = now.getUTCFullYear() + 100; + } onBlur(event) { this.blur.emit(); diff --git a/src/app/shared/form/number-picker/number-picker.component.ts b/src/app/shared/form/number-picker/number-picker.component.ts index 82240c41d11..40562dd61c0 100644 --- a/src/app/shared/form/number-picker/number-picker.component.ts +++ b/src/app/shared/form/number-picker/number-picker.component.ts @@ -103,13 +103,12 @@ export class NumberPickerComponent implements OnInit, ControlValueAccessor { if (i >= this.min && i <= this.max) { this.value = i; - this.emitChange(); } else if (event.target.value === null || event.target.value === '') { this.value = null; - this.emitChange(); } else { this.value = undefined; } + this.emitChange(); } catch (e) { this.value = undefined; }