diff --git a/projects/ngx-mat-birthday-input/src/lib/ngx-mat-birthday-input.component.ts b/projects/ngx-mat-birthday-input/src/lib/ngx-mat-birthday-input.component.ts index 79c443d..6e6cb45 100644 --- a/projects/ngx-mat-birthday-input/src/lib/ngx-mat-birthday-input.component.ts +++ b/projects/ngx-mat-birthday-input/src/lib/ngx-mat-birthday-input.component.ts @@ -350,14 +350,13 @@ export class NgxMatBirthdayInputComponent { minute: minute, hour: hour, + day: day ? day.padStart(2, '0') : '', + month: month ? month.padStart(2, '0') : '', year: year, datePicker: date ? new Date(date) : new Date(), }, { emitEvent: false }, ) - - this.itemForm.get('day')?.patchValue(day.padStart(2, '0'), { emitEvent: true }) - this.itemForm.get('month')?.patchValue(month.padStart(2, '0'), { emitEvent: true }) } registerOnChange(fn: any): void {