Converted Date to Moment. Since Datepicker is already using Moment adapter
This commit is contained in:
@@ -44,7 +44,7 @@ export class TrialBalanceComponent implements OnInit {
|
||||
info: TrialBalance = new TrialBalance();
|
||||
dataSource: TrialBalanceDataSource = new TrialBalanceDataSource(this.info.body, this.paginator, this.sort);
|
||||
form: FormGroup<{
|
||||
date: FormControl<Date>;
|
||||
date: FormControl<moment.Moment>;
|
||||
}>;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
@@ -59,7 +59,7 @@ export class TrialBalanceComponent implements OnInit {
|
||||
|
||||
constructor() {
|
||||
this.form = new FormGroup({
|
||||
date: new FormControl(new Date(), { nonNullable: true }),
|
||||
date: new FormControl(moment(new Date()), { nonNullable: true }),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ export class TrialBalanceComponent implements OnInit {
|
||||
|
||||
this.info = data.info;
|
||||
this.form.setValue({
|
||||
date: moment(this.info.date, 'DD-MMM-YYYY').toDate(),
|
||||
date: moment(this.info.date, 'DD-MMM-YYYY'),
|
||||
});
|
||||
this.dataSource = new TrialBalanceDataSource(this.info.body, this.paginator, this.sort);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user