Skip to content

Commit

Permalink
Merge pull request #3163 from AtlasOfLivingAustralia/feature/issue3162
Browse files Browse the repository at this point in the history
commit update #3162
  • Loading branch information
chrisala authored Apr 30, 2024
2 parents 5518249 + 74b5458 commit d469767
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions grails-app/views/organisation/_organisationReportHeader.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,25 @@

<div class="row mb-2">
<div class="col-sm-2 header-label">Reporting period end</div>

<div class="col-sm-9 value"><g:formatDate format="dd MMM yyyy"
date="${au.org.ala.merit.DateUtils.parse(report.toDate).toDate()}"/></div>
<%--
The reason this check is necessary is the reporting end date is selected by the user using a
date picker. The date picker sets the time to 00:00:00. This means that the date selected for the
final report ends up being midnight at the start of the final day. All generated reports will
use midnight at the start of the day after the end date. This means that when we display the
report end date for generated reports we should use the day before the actual end date,
except for the final report.
Note that for organisationReports, the selected end date is stored as the "periodEnd" for all
generated reporting periods which is why using the first one is sufficient.
--%>
<g:if test="${context.config.organisationReports.periodEnd[0] && report.toDate < context.config.organisationReports.periodEnd[0]}">
<div class="col-sm-9 value"><g:formatDate format="dd MMM yyyy"
date="${au.org.ala.merit.DateUtils.parse(report.toDate).minusDays(1).toDate()}"/></div>
</g:if>
<g:else>
<div class="col-sm-9 value"><g:formatDate format="dd MMM yyyy"
date="${au.org.ala.merit.DateUtils.parse(report.toDate).toDate()}"/></div>
</g:else>
</div>

<div class="row mb-2">
<div class="col-sm-2 header-label">Report status</div>

Expand Down

0 comments on commit d469767

Please sign in to comment.