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,7 +63,7 @@ export class ClosingStockComponent implements OnInit {
info: ClosingStock = new ClosingStock();
dataSource: ClosingStockDataSource = new ClosingStockDataSource(this.info.items, this.paginator, this.sort);
form: FormGroup<{
date: FormControl<Date>;
date: FormControl<moment.Moment>;
costCentre: FormControl<string | null>;
stocks: FormArray<
FormGroup<{
@@ -88,7 +88,7 @@ export class ClosingStockComponent implements OnInit {
constructor() {
this.costCentres = [];
this.form = new FormGroup({
date: new FormControl(new Date(), { nonNullable: true }),
date: new FormControl(moment(new Date()), { nonNullable: true }),
costCentre: new FormControl<string | null>(null),
stocks: new FormArray<FormGroup<{ physical: FormControl<number>; costCentre: FormControl<string | undefined> }>>(
[],
@@ -102,7 +102,7 @@ export class ClosingStockComponent implements OnInit {
this.info = data.info;
this.costCentres = data.costCentres;
this.form.patchValue({
date: moment(this.info.date, 'DD-MMM-YYYY').toDate(),
date: moment(this.info.date, 'DD-MMM-YYYY'),
costCentre: this.info.costCentre.id,
});
this.form.controls.stocks.clear();