Skip to content

Commit

Permalink
BAH-3049 | Fix. ESLint error | [Riya/Sweety/Deepti]
Browse files Browse the repository at this point in the history
  • Loading branch information
riyaTw committed Dec 6, 2023
1 parent 0323898 commit a3daacd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ui/app/reports/controllers/reportsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ angular.module('bahmni.reports')
},
reportsNotRequiringDateRange: {}
};

$scope.reportsDefined = true;
$scope.enableReportQueue = appService.getAppDescriptor().getConfigValue("enableReportQueue");

$scope.setDefault = function (item, header) {
var setToChange = (header === 'reportsRequiringDateRange') ? $rootScope.reportsRequiringDateRange : $rootScope.reportsNotRequiringDateRange;
var isPreviousMonth = $rootScope.default[header][item] === dateRange[2];
Expand All @@ -45,12 +45,11 @@ angular.module('bahmni.reports')
report.startDate = $filter('date')(dateRange[0], 'yyyy-MM-dd');
report.stopDate = isPreviousMonth ? getPreviousMonthEndDate() : dateRange[0];
report.responseType = format[1];
}
else {
} else {
report[item] = $rootScope.default[header][item];
}
});
};
};

var getPreviousMonthEndDate = function () {
return new Date(new Date().getFullYear(), new Date().getMonth(), 0);
Expand All @@ -72,8 +71,8 @@ angular.module('bahmni.reports')
}
report.reportTemplateLocation = report.config.macroTemplatePath;
}
report.startDate = Bahmni.Common.Util.DateUtil.getDateWithoutTime(report.startDate);
report.stopDate = Bahmni.Common.Util.DateUtil.getDateWithoutTime(report.stopDate);
report.startDate = Bahmni.Common.Util.DateUtil.getDateWithoutTime(report.startDate);
report.stopDate = Bahmni.Common.Util.DateUtil.getDateWithoutTime(report.stopDate);
if (isDateRangeRequiredFor(report) && (!report.startDate || !report.stopDate)) {
var msg = [];
if (!report.startDate) {
Expand Down

0 comments on commit a3daacd

Please sign in to comment.