I am using Angular UI datepicker in my project.
The control has the option "datepicker-popup", which allows me to configure the te format in which I want to display the date. However, the date is tied to my model as a date object, not as a formatted string.
The rest of my code just requires a date as a string in the correct format (yyyy-MM-dd).
At the time I need to use the date, I will format it to the correct string before passing it.
This works now, since the code base is quite small, but there is a better way to associate the date with my model as a string so that someone forgot to format the date before using it, it does not break the system.
A plunker for sample code can be found here.
I thought maybe I would need to set the clock or something else, but not too sure what would be the right solution.
source
share