I am using bootstrap date-picker in my angular application. However when I select a date from that date-picker underlying ng-model that I have bind gets updated I want that
The format
specified through datepicker-popup
is just the format for the displayed date. The underlying ngModel
is a Date object. Trying to display it will show it as it's default, standard-compliant rapresentation.
You can show it as you want by using the date
filter in the view, or, if you need it to be parsed in the controller, you can inject $filter
in your controller and call it as $filter('date')(date, format)
. See also the date filter docs.