diff --git a/public/js/controllers.js b/public/js/controllers.js index 628b4c9..707736e 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -627,6 +627,10 @@ wellCtrls.controller('fileListPreviousCtrl', function($scope, $http, $routeParam $scope.pageLoading = true; var getFileList = json.getFilePage(paramDate, page, $scope.numPerPage); getFileList.then(function(data) { + data.files = data.files.map(function(x){ + x.Stroke_Time = new Date(x.Stroke_Time); + return x; + }); $scope.filteredFiles = data.files; $scope.pageLoading = false; }); @@ -667,19 +671,25 @@ wellCtrls.controller('fileListTodayCtrl', function($scope, $http, $routeParams, getDateList.then(function(data) { $scope.dates = data.dates; $scope.currentDate = $scope.dates[0]; + $log.info($scope.currentDate); + var getCardCount = json.getCardCount($scope.currentDate.unconv); + getCardCount.then(function(cdata){ + $scope.numCards = cdata.count; + $scope.numPages = Math.ceil(cdata.count / $scope.numPerPage); + }); $scope.switchPage(1); }); - var getCardCount = json.getCardCount(paramDate); - getCardCount.then(function(cdata){ - $scope.numCards = cdata.count; - $scope.numPages = Math.ceil(cdata.count / $scope.numPerPage); - }); + $scope.switchPage = function(page){ $scope.currentPage = page; $scope.pageLoading = true; var getFileList = json.getFilePage($scope.currentDate.unconv, page, $scope.numPerPage); getFileList.then(function(data) { + data.files = data.files.map(function(x){ + x.Stroke_Time = new Date(x.Stroke_Time); + return x; + }); $scope.filteredFiles = data.files; $scope.pageLoading = false; }); diff --git a/public/partials/fileList.html b/public/partials/fileList.html index 2c822ad..3269bd3 100644 --- a/public/partials/fileList.html +++ b/public/partials/fileList.html @@ -24,7 +24,7 @@ Date - Fillage + Type @@ -33,9 +33,9 @@ - {{file.Stroke_Time | date: "medium"}} - {{file.Fillage_Percent | number: 2}} % - {{file.Card_Type}} + {{new Date(file.Stroke_Time) | date: "medium"}} + + {{file.Card_Type}} Download CSV