If I have an Angular Form Control as below, what would be the recommended way to format the value?
e.g. I could have a date field returned from the database with seconds and milliseconds etc. How can I format this is a similar way to the date pipe so I just show day, month, year etc?
<input type="text" [formControl]="date">
My typescript file would be as follows:
export class MyForm {
form: FormGroup;
ngOnInit(): void {
this.setupForm();
this.httpService.get(5).subscribe((response) => {
this.form.patchValue(response);
});
}
setupForm(): void {
this.form = new FormGroup({
date: new FormControl('')
});
}
}