Add current date in top bar

This commit is contained in:
Francis Lachapelle
2015-03-26 08:52:48 -04:00
parent 0241cacbf9
commit 516e5fd303
9 changed files with 87 additions and 11 deletions
+11 -1
View File
@@ -116,7 +116,17 @@
return l;
})
.controller('navController', ['$scope', '$timeout', '$mdSidenav', '$mdBottomSheet', '$mdMedia', '$log', 'sgConstant', function ($scope, $timeout, $mdSidenav, $mdBottomSheet, $mdMedia, $log, sgConstant) {
.controller('navController', ['$scope', '$timeout', '$interval', '$http', '$mdSidenav', '$mdBottomSheet', '$mdMedia', '$log', 'sgConstant', function ($scope, $timeout, $interval, $http, $mdSidenav, $mdBottomSheet, $mdMedia, $log, sgConstant) {
// Show current day in top bar
$scope.currentDay = window.currentDay;
$timeout(function() {
// Update date when day ends
$interval(function() {
$http.get('../date').success(function(data) {
$scope.currentDay = data;
});
}, 24 * 3600 * 1000);
}, window.secondsBeforeTomorrow * 1000);
$scope.toggleLeft = function () {
$mdSidenav('left').toggle()