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
@@ -45,8 +45,8 @@ export class PurchaseEntriesComponent implements OnInit {
|
||||
info: PurchaseEntries = new PurchaseEntries();
|
||||
dataSource: PurchaseEntriesDataSource = new PurchaseEntriesDataSource(this.info.body, this.paginator, this.sort);
|
||||
form: FormGroup<{
|
||||
startDate: FormControl<Date>;
|
||||
finishDate: FormControl<Date>;
|
||||
startDate: FormControl<moment.Moment>;
|
||||
finishDate: FormControl<moment.Moment>;
|
||||
}>;
|
||||
|
||||
selectedRowId = '';
|
||||
@@ -62,8 +62,8 @@ export class PurchaseEntriesComponent implements OnInit {
|
||||
|
||||
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 }),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ export class PurchaseEntriesComponent implements OnInit {
|
||||
|
||||
this.info = data.info;
|
||||
this.form.setValue({
|
||||
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'),
|
||||
});
|
||||
this.dataSource = new PurchaseEntriesDataSource(this.info.body, this.paginator, this.sort);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user