Skip to content

Commit

Permalink
BAH-3049 | Samridhi | Added fix for start-stop date
Browse files Browse the repository at this point in the history
  • Loading branch information
Samridhi-98 committed Oct 1, 2023
1 parent c6231fa commit a3a77b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ui/app/reports/controllers/reportsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ angular.module('bahmni.reports')
report['stopDate'] = dateRange[0];
}
else if ($rootScope.default[header][item] === undefined) {
$rootScope.default.reportsRequiringDateRange.startDate = dateRange[0];
$rootScope.reportsRequiringDateRange.forEach(function (report) {
report.startDate = dateRange[0];
report.stopDate = dateRange[0];
Expand Down Expand Up @@ -76,8 +77,8 @@ angular.module('bahmni.reports')
if (!report.stopDate) {
msg.push("end date");
}
if (report.startDate > report.stopDate) {
msg.push("start date can not be greeater than stop date");
if ((report.startDate > report.stopDate)) {
msg.push("start date can not be greater than stop date");
}
messagingService.showMessage("error", "Please select the " + msg.join(" and "));
return false;
Expand Down
2 changes: 1 addition & 1 deletion ui/app/reports/views/reports.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h2 class="section-title">{{::'REPORTS_TITLE_KEY' | translate}}</h2>
<th class="reports-stop-date">{{::'REPORTS_END_DATE_HEADER_KEY' |translate}}
<span class="asterick">*</span>
<input ng-model="default.reportsRequiringDateRange.stopDate" date-converter
class="form-field start-date" type="date" min="{{default.reportsRequiringDateRange.startDate | date:'yyyy-MM-dd'}}"
class="form-field stop-date" type="date" min="{{default.reportsRequiringDateRange.startDate | date:'yyyy-MM-dd'}}"
ng-change="setDefault('stopDate', 'reportsRequiringDateRange')">
</th>
<th class="reports-format">
Expand Down

0 comments on commit a3a77b0

Please sign in to comment.