Fix, date picker would not change the date.

This commit is contained in:
2026-09-11 10:08:26 +00:00
parent 63654c1f99
commit 92e960d75d
2 changed files with 23 additions and 2 deletions
@@ -50,14 +50,14 @@ export class EmployeeFunctionsComponent {
}
chosenYearHandler(normalizedYear: moment.Moment) {
const ctrlValue = this.creditSalaryModel().date ?? moment();
const ctrlValue = moment(this.creditSalaryModel().date);
ctrlValue.year(normalizedYear.year());
ctrlValue.date(ctrlValue.daysInMonth());
this.creditSalaryModel.update((m) => ({ ...m, date: ctrlValue }));
}
chosenMonthHandler(normlizedMonth: moment.Moment, datepicker: MatDatepicker<moment.Moment>) {
const ctrlValue = this.creditSalaryModel().date ?? moment();
const ctrlValue = moment(this.creditSalaryModel().date);
ctrlValue.month(normlizedMonth.month());
ctrlValue.date(ctrlValue.daysInMonth());
this.creditSalaryModel.update((m) => ({ ...m, date: ctrlValue }));