From 2ceb4f1119a0e22b0374c63c4f8b68a51c6f3da8 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Tue, 18 Jul 2023 11:56:51 -0400 Subject: [PATCH] (bug) incorrect date range in statistics --- .../src/javascript/controllers/admin/statistics.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/frontend/src/javascript/controllers/admin/statistics.js b/app/frontend/src/javascript/controllers/admin/statistics.js index ca545b2e1..12c80ca72 100644 --- a/app/frontend/src/javascript/controllers/admin/statistics.js +++ b/app/frontend/src/javascript/controllers/admin/statistics.js @@ -502,8 +502,8 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', scroll: ES_SCROLL_TIME + 'm', 'stat-type': type, 'custom-query': custom ? JSON.stringify(Object.assign({ exclude: custom.exclude }, buildElasticCustomCriterion(custom))) : '', - 'start-date': moment($scope.datePickerStart.selected).format(), - 'end-date': moment($scope.datePickerEnd.selected).format(), + 'start-date': moment($scope.datePickerStart.selected).format('YYYY-MM-DD'), + 'end-date': moment($scope.datePickerEnd.selected).format('YYYY-MM-DD'), body: buildElasticDataQuery(type, custom, $scope.agePicker.start, $scope.agePicker.end, moment($scope.datePickerStart.selected), moment($scope.datePickerEnd.selected), $scope.sorting) } , function (error, response) { @@ -537,8 +537,8 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', { range: { date: { - gte: intervalBegin.format(), - lte: intervalEnd.format() + gte: intervalBegin.format('YYYY-MM-DD'), + lte: intervalEnd.format('YYYY-MM-DD') } } } @@ -767,8 +767,8 @@ Application.Controllers.controller('ExportStatisticsController', ['$scope', '$ui { range: { date: { - gte: moment($scope.dates.start).format(), - lte: moment($scope.dates.end).format() + gte: moment($scope.dates.start).format('YYYY-MM-DD'), + lte: moment($scope.dates.end).format('YYYY-MM-DD') } } }