Below is the code I am currently using:
this.elService.getOne(id)
.subscribe((result: ModelName) => {
let test = this.datePipe.transform(result['birthDate'], 'mm/dd/yyyy')
result['birthDate']= test
console.log(result['birthDate'])
this.parentForm.patchValue(result)})
I am attempting to alter the date format, but encountered an error indicating that ** result['birthDate']** is being treated as a String instead of a date. Consequently, I modified it to ** result['birthDate']= new Date(test)** however, this resulted in an invalid date. Please note that I am utilizing DatePicker. Does anyone have any suggestions or guidance?