Skip to content

Commit

Permalink
Fix datetime formatting in gbif compare view
Browse files Browse the repository at this point in the history
  • Loading branch information
matsbov committed Oct 1, 2024
1 parent bda590e commit d7157b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ class GbifController {
gbifKey: dr.gbifRegistryKey,
type: dr.resourceType,
repatriationCountry: dr.repatriationCountry,
gbifPublished: gbifService.getGbifDatasetLastUpdated(dr.gbifRegistryKey),
gbifPublished: gbifService.getGbifDatasetLastUpdated(dr.gbifRegistryKey).toInstant(),
gbifCount: gbifDatasetRecordCountMap.getOrDefault(dr.gbifRegistryKey, 0),
atlasCount: atlasDatasetRecordCountMap.getOrDefault(dr.uid, 0),
atlasPublished: dr.lastUpdated,
atlasPublished: dr.lastUpdated.toInstant(),
status: ""
]

Expand Down
12 changes: 6 additions & 6 deletions grails-app/views/gbif/compareWithAtlas.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
${item.repatriationCountry}
</td>
<td>
<g:formatDate type="datetime" date="${item.gbifPublished}"/>
<g:formatDate format="yyyy-MM-dd HH:mm" date="${item.gbifPublished}"/>
</td>
<td <g:if test="${item.gbifPublished > item.atlasPublished}">style="color: red"</g:if>>
<g:formatDate type="datetime" date="${item.atlasPublished}"/>
<g:formatDate format="yyyy-MM-dd HH:mm" date="${item.atlasPublished}"/>
</td>
<td style="text-align: right;">
<g:formatNumber number="${item.gbifCount}" format="###,###,##0" />
Expand Down Expand Up @@ -90,11 +90,11 @@
<td></td>
<td></td>
<td></td>
<td style="text-align: right">
<em><g:formatNumber number="${gbifTotalCount}" format="###,###,##0" /></em>
<td style="text-align: right; font-style: italic;">
<g:formatNumber number="${gbifTotalCount}" format="###,###,##0" />
</td>
<td style="text-align: right; font-style: italic; <g:if test="${gbifTotalCount != atlasTotalCount}">color: red</g:if>">
<em><g:formatNumber number="${atlasTotalCount}" format="###,###,##0" /></em>
<g:formatNumber number="${atlasTotalCount}" format="###,###,##0" />
</td>
<td style="text-align: right; font-style: italic; color: red">
<g:if test="${gbifTotalCount != atlasTotalCount}">
Expand All @@ -111,7 +111,7 @@
paging: false,
searching: false,
info: false,
columnDefs: [{ type: 'num-fmt', targets: [6, 7] }],
columnDefs: [{ type: 'num-fmt', targets: [6, 7, 8] }],
});
});
</script>
Expand Down

0 comments on commit d7157b1

Please sign in to comment.