In Angular 13 application, using PrimeNG Calendar
<p-calendar [minDate]="today" [showIcon]="true" styleClass="form-control" showButtonBar="true"
dateFormat="dd/mm/yy" inputId="icon" placeholder="dd/mm/yy"
formControlName="eventStartDate"></p-calendar>
using in a Reactive form, it is working fine while save new form.same form I am using for edit also.
To edit the form loading the data based on code.
But while patchValue
to the form, getting the error
ERROR Unexpected literal at position 2
the edit code
loadEventToEdit() {
this.eventService.getEventByCode(this.eventCode).subscribe((res) => {
this.event = res;
console.log('the event to update', this.event);
this.theForm.patchValue(res);
Rest of fileds path value is working fine.