Browse Source

fixed sleectedDate not updating

tags/1.0.0
Robin Thoni 8 years ago
parent
commit
719a41923f
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      app/controllers/home.controller.js

+ 3
- 1
app/controllers/home.controller.js View File

49
             $scope.getMonday = function(d)
49
             $scope.getMonday = function(d)
50
             {
50
             {
51
                 d = new Date(d);
51
                 d = new Date(d);
52
-                var day = d.getDay(), diff = d.getDate() - day + (day == 0 ? -6:1); // adjust when day is sunday
52
+                var day = d.getDay();
53
+                var diff = d.getDate() - day + (day == 0 ? -6:1);
53
                 d = new Date(d.setDate(diff));
54
                 d = new Date(d.setDate(diff));
54
                 d.setHours(0, 0, 0, 0);
55
                 d.setHours(0, 0, 0, 0);
55
                 return d;
56
                 return d;
167
             $scope.goToRelativeWeek = function(relativeWeek)
168
             $scope.goToRelativeWeek = function(relativeWeek)
168
             {
169
             {
169
                 $scope.selectedDate.setDate($scope.selectedDate.getDate() + (relativeWeek * 7));
170
                 $scope.selectedDate.setDate($scope.selectedDate.getDate() + (relativeWeek * 7));
171
+                $scope.selectedDate = new Date($scope.selectedDate);
170
                 $scope.loadWeeks();
172
                 $scope.loadWeeks();
171
             };
173
             };
172
 
174
 

Loading…
Cancel
Save