Change regional to "en-us" datepicker with AngularJS

1

I would like to change the reginal to "en" in my datepicker, I am using AngularJS.

<input type="text" ng-model="date" jqdatepicker />
<br/>
{{ date }}

var myApp= angular.module('app', []);
myApp.directive('datepicker', function() {


return {  
require: 'ngModel',
link: function(scope, el, attr, ngModel) {
  $(el).datepicker({
    onSelect: function(dateText) {
      scope.$apply(function() {
        var date = Date.parse(dateText) || 0;
        ngModel.$setViewValue(date);
      });
    }
  });
} 

};
});
    
asked by anonymous 16.02.2017 / 13:43

1 answer

1

Add its locale file in the page header, as shown:

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.6.2/angular.js"></script><scriptsrc="http://code.angularjs.org/1.6.2/i18n/angular-locale_pt-br.js"></script>
    
16.02.2017 / 13:54