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
@@ -66,10 +66,10 @@ export class RateContractDetailComponent implements OnInit, AfterViewInit {
public itemsObservable = new BehaviorSubject<RateContractItem[]>([]);
dataSource: RateContractDetailDatasource = new RateContractDetailDatasource(this.itemsObservable);
form: FormGroup<{
date: FormControl<Date>;
date: FormControl<moment.Moment>;
account: FormControl<string | null>;
validFrom: FormControl<Date>;
validTill: FormControl<Date>;
validFrom: FormControl<moment.Moment>;
validTill: FormControl<moment.Moment>;
addRow: FormGroup<{
product: FormControl<string | null>;
price: FormControl<string>;
@@ -96,10 +96,10 @@ export class RateContractDetailComponent implements OnInit, AfterViewInit {
constructor() {
this.form = new FormGroup({
date: new FormControl(new Date(), { nonNullable: true }),
date: new FormControl(moment(new Date()), { nonNullable: true }),
account: new FormControl<string | null>(null),
validFrom: new FormControl(new Date(), { nonNullable: true }),
validTill: new FormControl(new Date(), { nonNullable: true }),
validFrom: new FormControl(moment(new Date()), { nonNullable: true }),
validTill: new FormControl(moment(new Date()), { nonNullable: true }),
addRow: new FormGroup({
product: new FormControl(''),
price: new FormControl('', { nonNullable: true }),
@@ -129,9 +129,9 @@ export class RateContractDetailComponent implements OnInit, AfterViewInit {
loadItem(item: RateContract) {
this.item = item;
this.form.setValue({
date: moment(this.item.date, 'DD-MMM-YYYY').toDate(),
validFrom: moment(this.item.validFrom, 'DD-MMM-YYYY').toDate(),
validTill: moment(this.item.validTill, 'DD-MMM-YYYY').toDate(),
date: moment(this.item.date, 'DD-MMM-YYYY'),
validFrom: moment(this.item.validFrom, 'DD-MMM-YYYY'),
validTill: moment(this.item.validTill, 'DD-MMM-YYYY'),
account: this.item.vendor?.name ?? '',
addRow: {
product: '',