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
@@ -56,7 +56,7 @@ export class IncentiveComponent implements OnInit {
public incentiveObservable = new BehaviorSubject<Incentive[]>([]);
dataSource: IncentiveDataSource = new IncentiveDataSource(this.incentiveObservable);
form: FormGroup<{
date: FormControl<Date>;
date: FormControl<moment.Moment>;
incentives: FormArray<
FormGroup<{
points: FormControl<number>;
@@ -79,7 +79,7 @@ export class IncentiveComponent implements OnInit {
constructor() {
this.form = new FormGroup({
date: new FormControl(new Date(), { nonNullable: true }),
date: new FormControl(moment(new Date()), { nonNullable: true }),
incentives: new FormArray<FormGroup<{ points: FormControl<number> }>>([]),
});
// Listen to Date Change
@@ -103,7 +103,7 @@ export class IncentiveComponent implements OnInit {
loadVoucher(voucher: Voucher) {
this.voucher = voucher;
this.form.controls.date.setValue(moment(this.voucher.date, 'DD-MMM-YYYY').toDate());
this.form.controls.date.setValue(moment(this.voucher.date, 'DD-MMM-YYYY'));
this.form.controls.incentives.clear();
this.voucher.incentives.forEach((x) =>
this.form.controls.incentives.push(