From 7be3520c29163066d7fe45f4702d5d2172db201d Mon Sep 17 00:00:00 2001 From: David Poindexter Date: Wed, 31 Jan 2024 01:50:44 -0500 Subject: [PATCH] Implement Last 30 Days for default Manage User Activity dates --- .../user-activity/user-activity-list.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/user-activity/user-activity-list.js b/app/controllers/user-activity/user-activity-list.js index e41bba4..cf9573c 100644 --- a/app/controllers/user-activity/user-activity-list.js +++ b/app/controllers/user-activity/user-activity-list.js @@ -157,19 +157,31 @@ return date; }; + $scope.getDate30DaysAgo = function () { + var date = new Date(); + date.setDate(date.getDate() - 30); + return date; + }; + $scope.rollingYear = function () { $scope.period_start = $scope.getDateOneYearAgo(); $scope.period_end = $scope.getCurrentDate(); $scope.getUserActivity(); }; + $scope.last30Days = function () { + $scope.period_start = $scope.getDate30DaysAgo(); + $scope.period_end = $scope.getCurrentDate(); + $scope.getUserActivity(); + }; + init = function () { var promises = []; promises.push($scope.getActivities()); return $q.all(promises); }; init(); - $scope.rollingYear(); + $scope.last30Days(); }]);