Converted Date to Moment. Since Datepicker is already using Moment adapter

This commit is contained in:
2025-07-15 19:04:35 +00:00
parent d3588977a5
commit c542114e42
25 changed files with 126 additions and 126 deletions
@@ -63,8 +63,8 @@ export class EmployeeAttendanceComponent implements OnInit, AfterViewInit {
dataSource: EmployeeAttendanceDataSource = new EmployeeAttendanceDataSource(this.employeeAttendanceObservable);
form: FormGroup<{
startDate: FormControl<Date>;
finishDate: FormControl<Date>;
startDate: FormControl<moment.Moment>;
finishDate: FormControl<moment.Moment>;
employee: FormControl<string | null>;
attendances: FormArray<
FormGroup<{
@@ -89,8 +89,8 @@ export class EmployeeAttendanceComponent implements OnInit, AfterViewInit {
constructor() {
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
startDate: new FormControl(moment(new Date()), { nonNullable: true }),
finishDate: new FormControl(moment(new Date()), { nonNullable: true }),
employee: new FormControl<string | null>(null),
attendances: new FormArray<FormGroup<{ attendanceType: FormControl<number> }>>([]),
});
@@ -108,8 +108,8 @@ export class EmployeeAttendanceComponent implements OnInit, AfterViewInit {
this.info = data.info;
this.attendanceTypes = data.attendanceTypes;
this.form.controls.startDate.setValue(moment(this.info.startDate, 'DD-MMM-YYYY').toDate());
this.form.controls.finishDate.setValue(moment(this.info.finishDate, 'DD-MMM-YYYY').toDate());
this.form.controls.startDate.setValue(moment(this.info.startDate, 'DD-MMM-YYYY'));
this.form.controls.finishDate.setValue(moment(this.info.finishDate, 'DD-MMM-YYYY'));
this.form.controls.employee.setValue(this.info.employee?.name ?? '');
this.form.controls.attendances.clear();
this.info.body.forEach((x) =>