Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar shows dates as a day out #276

Open
Bonaventure21 opened this issue Oct 16, 2018 · 0 comments
Open

Calendar shows dates as a day out #276

Bonaventure21 opened this issue Oct 16, 2018 · 0 comments

Comments

@Bonaventure21
Copy link

I'm having some trouble setting up the picker with locale="en-gb".
Using the exact code below in plunker (Chrome Version 69.0.3497.100 (Official Build) (64-bit)).
As soon as I add the ngModel as a moment object; the calendar shows all dates as a day out.
i.e. 21/10/2018 shows as Monday instead of Sunday.

https://plnkr.co/edit/Cl2tjXm5cZB8JjQnigZH?p=preview

<!doctype html>
<html lang="en" ng-app="myApp">

<head>
  <meta charset="utf-8">
  <title>Angular Moment Picker</title>

  <!-- scripts -->
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment-with-locales.js"></script>
  <script src="//cdn.rawgit.com/indrimuska/angular-moment-picker/master/dist/angular-moment-picker.min.js"></script>
  <link href="//cdn.rawgit.com/indrimuska/angular-moment-picker/master/dist/angular-moment-picker.min.css" rel="stylesheet">
  <script>
    var myApp = angular.module('myApp', ['moment-picker']);

    myApp.controller('ExampleCtrl', ['$scope', function($scope) {
      var vm = this;
      vm.fromDateString = "2018-10-08T15:45:22.234Z";
      vm.fromMoment = moment(vm.fromDateString);
    }]);
  </script>
</head>

<body>
  <div ng-controller="ExampleCtrl as ctrl2">
    <input moment-picker="ctrl2.fromDateString" ng-model="ctrl2.fromMoment" locale="en-gb" start-view="month" />
  </div>
</body>

</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant