Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyuanlu committed Jun 13, 2023
1 parent 80693d3 commit a3959f4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ app.controller('MetricCtl', ['$scope', '$stateParams', 'MetricService', '$interv
$scope.startTime = new Date();
$scope.endTime = new Date();
$scope.startTime.setMinutes($scope.endTime.getMinutes() - timeInterval);
$scope.startTimeFmt = formatDate($scope.startTime);
$scope.endTimeFmt = formatDate($scope.endTime);
$scope.endDateBeforeRender = endDateBeforeRender;
$scope.endDateOnSetTime = endDateOnSetTime;
$scope.startDateBeforeRender = startDateBeforeRender;
Expand Down Expand Up @@ -64,14 +62,15 @@ app.controller('MetricCtl', ['$scope', '$stateParams', 'MetricService', '$interv

$scope.quickOnSetTime = function(calculate, offset) {
if (calculate === 0) {
$scope.startTime = new Date();
$scope.endTime = new Date();
$scope.startTime.setMinutes($scope.endTime.getMinutes() - timeInterval);
} else {
let offsetTime = calculate > 0?
$scope.endTime.getMinutes() + offset:
$scope.endTime.getMinutes() - offset;
$scope.startTime.setMinutes(offsetTime - timeInterval);
$scope.endTime.setMinutes(offsetTime);
$scope.startTime.setMinutes(offsetTime - timeInterval);
}
queryIdentityDatas();
}
Expand Down

0 comments on commit a3959f4

Please sign in to comment.