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
@@ -42,8 +42,8 @@ export class ProfitLossComponent implements OnInit {
info: ProfitLoss = new ProfitLoss();
dataSource: ProfitLossDataSource = new ProfitLossDataSource(this.info.body, this.paginator, this.sort);
form: FormGroup<{
startDate: FormControl<Date>;
finishDate: FormControl<Date>;
startDate: FormControl<moment.Moment>;
finishDate: FormControl<moment.Moment>;
}>;
selectedRowId = '';
@@ -59,8 +59,8 @@ export class ProfitLossComponent implements OnInit {
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 }),
});
}
@@ -70,8 +70,8 @@ export class ProfitLossComponent implements OnInit {
this.info = data.info;
this.form.setValue({
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate(),
startDate: moment(this.info.startDate, 'DD-MMM-YYYY'),
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY'),
});
this.dataSource = new ProfitLossDataSource(this.info.body, this.paginator, this.sort);
});