Storage option in format for DatePicker
I would like to have the possibility to define the storage format. Now you can define the parse format and the display format, but it would be nice if we could store the result of the datepicker as a formatted string in the NgModel.
We have a REST call where the selected date is parsed as a Date, not DateTime. So now we have to format the selected Date before we can send it to the rest service, it would be nice if we could arrange that in the formatter. I'm thinking of something like this:
export const FORMAT_DATE = {
store: {
YYYY-MM-DD
}
parse: {
dateInput: 'L',
},
display: {
dateInput: 'L',
monthYearLabel: 'MMM YYYY',
dateA11yLabel: 'LL',
monthYearA11yLabel: 'MMMM YYYY',
},
};
It implicitly works like that already; the datepicker is designed such that the date model is completely opaque to the component. This is how it can work with the JS Date, Moment.JS date, and whatever other date representation.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.