Converted Date to Moment. Since Datepicker is already using Moment adapter
This commit is contained in:
1 parent
d3588977a5
commit
c542114e42
25 files changed
+126
-126
No files matched your search
@@ -82,8 +82,8 @@ export class LedgerComponent implements OnInit, AfterViewInit {
|
||||
allTags: Tag[] = [];
|
||||
tags: string[] = [];
|
||||
form: FormGroup<{
|
||||
startDate: FormControl<Date>;
|
||||
finishDate: FormControl<Date>;
|
||||
startDate: FormControl<moment.Moment>;
|
||||
finishDate: FormControl<moment.Moment>;
|
||||
account: FormControl<string | null>;
|
||||
tags: FormControl<string[]>;
|
||||
}>;
|
||||
@@ -103,8 +103,8 @@ export class LedgerComponent implements OnInit, AfterViewInit {
|
||||
|
||||
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 }),
|
||||
account: new FormControl<string | null>(null),
|
||||
tags: new FormControl<string[]>([], { nonNullable: true }),
|
||||
});
|
||||
@@ -128,8 +128,8 @@ export class LedgerComponent implements OnInit, AfterViewInit {
|
||||
];
|
||||
this.form.setValue({
|
||||
account: this.info.account?.name ?? '',
|
||||
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'),
|
||||
tags: this.tags,
|
||||
});
|
||||
this.body.next(this.info.body);
|
||||
|
||||
Reference in new issue
Block a user