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
@@ -39,7 +39,7 @@ export class RecipeTemplateDetailComponent implements OnInit, AfterViewInit {
@ViewChild('nameElement', { static: true }) nameElement!: ElementRef<HTMLInputElement>;
form: FormGroup<{
name: FormControl<string>;
date: FormControl<Date>;
date: FormControl<moment.Moment>;
text: FormControl<string>;
selected: FormControl<boolean>;
}>;
@@ -49,7 +49,7 @@ export class RecipeTemplateDetailComponent implements OnInit, AfterViewInit {
constructor() {
this.form = new FormGroup({
name: new FormControl<string>('', { nonNullable: true }),
date: new FormControl(new Date(), { nonNullable: true }),
date: new FormControl(moment(new Date()), { nonNullable: true }),
text: new FormControl<string>('', { nonNullable: true }),
selected: new FormControl<boolean>(false, { nonNullable: true }),
});
@@ -67,7 +67,7 @@ export class RecipeTemplateDetailComponent implements OnInit, AfterViewInit {
this.item = item;
this.form.setValue({
name: this.item.name,
date: moment(this.item.date, 'DD-MMM-YYYY').toDate(),
date: moment(this.item.date, 'DD-MMM-YYYY'),
text: this.item.text,
selected: this.item.selected,
});