Ok the issue it seems to come from this line:
https://github.com/angular-ui/ui-date/blob/master/src/date.js#L106.
Actually this line it's the binding with jQuery UI which it should be the place to inject the data format.
As you can see in var opts
there is no property dateFormat
with the value from ng-date-format as you could espect.
Anyway the directive has a constant called uiDateConfig
to add properties to opts
.
The flexible solution (recommended):
From here you can see you can insert some options injecting in the directive a controller variable with the jquery ui options.
<input ui-date="dateOptions" ui-date-format="mm/dd/yyyy" ng-model="valueofdate" />
myAppModule.controller('MyController', function($scope) {
$scope.dateOptions = {
dateFormat: "dd-M-yy"
};
});
The hardcoded solution:
If you don't want to repeat this procedure all the time change the value of uiDateConfig
in date.js to:
.constant('uiDateConfig', { dateFormat: "dd-M-yy" })