I have an Angular reactive form with event_date field. I want to modify the data before assigning to form.
For example I have date in format of:
Tue Aug 28 2018 00:00:00 GMT+0400 (Armenia Standard Time)
And I want to modify it with toLocalString() before assigning to form.
I have tried to use arrow function instead of default value, but with no result.
tournamentEventForm() : FormGroup{
return this.fb.group({
'event_description': '',
'event_date': (dateString: string)=>{return 'modified string'},
'event_time': ''
})
}
Is there any way to do it without onChange listeners and using only formBuilder syntax?