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
+21
View File
@@ -29,5 +29,26 @@
"PYTHONUNBUFFERED": "1" "PYTHONUNBUFFERED": "1"
} }
}, },
{
"name": "Python: FastAPI (Live Reload)",
"type": "debugpy",
"request": "launch",
"module": "uvicorn",
"args": [
"brewman.main:app",
"--host",
"0.0.0.0",
"--port",
"9998",
"--reload"
],
"cwd": "${workspaceFolder}/brewman",
"subProcess": true,
"justMyCode": true,
"envFile": "${workspaceFolder}/.env",
"env": {
"PYTHONUNBUFFERED": "1"
}
}
], ],
} }
@@ -50,14 +50,14 @@ export class EmployeeFunctionsComponent {
} }
chosenYearHandler(normalizedYear: moment.Moment) { chosenYearHandler(normalizedYear: moment.Moment) {
const ctrlValue = this.creditSalaryModel().date ?? moment(); const ctrlValue = moment(this.creditSalaryModel().date);
ctrlValue.year(normalizedYear.year()); ctrlValue.year(normalizedYear.year());
ctrlValue.date(ctrlValue.daysInMonth()); ctrlValue.date(ctrlValue.daysInMonth());
this.creditSalaryModel.update((m) => ({ ...m, date: ctrlValue })); this.creditSalaryModel.update((m) => ({ ...m, date: ctrlValue }));
} }
chosenMonthHandler(normlizedMonth: moment.Moment, datepicker: MatDatepicker<moment.Moment>) { 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.month(normlizedMonth.month());
ctrlValue.date(ctrlValue.daysInMonth()); ctrlValue.date(ctrlValue.daysInMonth());
this.creditSalaryModel.update((m) => ({ ...m, date: ctrlValue })); this.creditSalaryModel.update((m) => ({ ...m, date: ctrlValue }));