Fix, date picker would not change the date.
This commit is contained in:
@@ -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 }));
|
||||
|
||||
Reference in New Issue
Block a user