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,7 +49,8 @@ angular.module('app')
49 49
             $scope.getMonday = function(d)
50 50
             {
51 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 54
                 d = new Date(d.setDate(diff));
54 55
                 d.setHours(0, 0, 0, 0);
55 56
                 return d;
@@ -167,6 +168,7 @@ angular.module('app')
167 168
             $scope.goToRelativeWeek = function(relativeWeek)
168 169
             {
169 170
                 $scope.selectedDate.setDate($scope.selectedDate.getDate() + (relativeWeek * 7));
171
+                $scope.selectedDate = new Date($scope.selectedDate);
170 172
                 $scope.loadWeeks();
171 173
             };
172 174
 

Loading…
Cancel
Save