I would like to expose my date value as date only ("yyyy-MM-dd") on an Angular Material date picker. Currently, the default date value is an ISO format (includes time).
I have a starter Stackblitz project with the the required setup. The formly-datepicker.type
is where I would like to centralize the conversion so that any date used in the model will be formatted properly for the service layer.
One of my attempts to accomplish it in a centralized manner is using the Angular ControlValueAccessor, but the value is never updated. ControlValueAccessor Stackblitz
In the example Stackblitz, after changing the date and clicking Submit the value I need returned would be something like: {"mydate":"1940-03-11"}
(without the time information).