Fix, date picker would not change the date.

This commit is contained in:
tanshu committed 2026-09-11 10:08:26 +00:00
1 parent 63654c1f99
commit 92e960d75d
2 files changed
+23 -2

No files matched your search

@@ -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 }));