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 Sep 27, 2023
1 parent a8bb471 commit c6231fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ui/app/reports/controllers/reportsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ 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");
}
messagingService.showMessage("error", "Please select the " + msg.join(" and "));
return false;
}
Expand Down
6 changes: 2 additions & 4 deletions ui/app/reports/views/reports.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ <h2 class="section-title">{{::'REPORTS_TITLE_KEY' | translate}}</h2>
<tr ng-repeat="report in ::reportsRequiringDateRange" show-if-privilege="{{:: report.requiredPrivilege}}">
<td>{{:: report.name |translate }}</td>
<td class="reports-start-date">
<input date-converter class="form-field start-date" type="date" max="{{report.stopDate + 1 | date:'yyyy-MM-dd'}}"
ng-model="report.startDate">
<input date-converter class="form-field start-date" type="date" ng-model="report.startDate">
</td>
<td class="reports-stop-date">
<input date-converter class="form-field stop-date" type="date" min="{{report.startDate | date:'yyyy-MM-dd'}}"
ng-model="report.stopDate">
<input date-converter class="form-field stop-date" type="date" min="{{report.startDate | date:'yyyy-MM-dd'}}" ng-model="report.stopDate">
</td>
<td class="reports-format">
<select ng-model="report.responseType" ng-options="type as label for (label , type) in ::formats">
Expand Down

0 comments on commit c6231fa

Please sign in to comment.