Converted Date to Moment. Since Datepicker is already using Moment adapter
This commit is contained in:
@@ -63,7 +63,7 @@ export class MozimoDailyRegisterComponent implements OnInit {
|
||||
dataSource: MozimoDailyRegisterDataSource = new MozimoDailyRegisterDataSource(this.body);
|
||||
|
||||
form: FormGroup<{
|
||||
date: FormControl<Date>;
|
||||
date: FormControl<moment.Moment>;
|
||||
items: FormArray<
|
||||
FormGroup<{
|
||||
received: FormControl<number>;
|
||||
@@ -80,7 +80,7 @@ export class MozimoDailyRegisterComponent implements OnInit {
|
||||
|
||||
constructor() {
|
||||
this.form = new FormGroup({
|
||||
date: new FormControl(new Date(), { nonNullable: true }),
|
||||
date: new FormControl(moment(new Date()), { nonNullable: true }),
|
||||
items: new FormArray<
|
||||
FormGroup<{
|
||||
received: FormControl<number>;
|
||||
@@ -98,7 +98,7 @@ export class MozimoDailyRegisterComponent implements OnInit {
|
||||
const data = value as { info: MozimoDailyRegister };
|
||||
this.info = data.info;
|
||||
this.form.patchValue({
|
||||
date: moment(this.info.date, 'DD-MMM-YYYY').toDate(),
|
||||
date: moment(this.info.date, 'DD-MMM-YYYY'),
|
||||
});
|
||||
this.form.controls.items.clear();
|
||||
this.info.body.forEach((x) =>
|
||||
|
||||
Reference in New Issue
Block a user