Skip to content

Commit

Permalink
ISO19139 / ISO19115.3 / Index resource date fields as defined in the …
Browse files Browse the repository at this point in the history
…metadata.

Previously the values were converted to UTC. If the timezone defined in the server is Europe/Madrid and the metadata has a creation date '2023-01-01T00:00:00', the index field creationYearForResource had the value 2022
  • Loading branch information
josegar74 authored and fxprunayre committed Sep 23, 2024
1 parent 94c0586 commit 8436990
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,16 @@
</xsl:variable>
<xsl:choose>
<xsl:when test="$zuluDateTime != ''">
<!-- Store original date information for the resource, instead of $zuluDateTime,
to avoid timezone shifts when used for facet filters -->
<xsl:element name="{$dateType}DateForResource">
<xsl:value-of select="$zuluDateTime"/>
<xsl:value-of select="$date"/>
</xsl:element>
<xsl:element name="{$dateType}YearForResource">
<xsl:value-of select="substring($zuluDateTime, 0, 5)"/>
<xsl:value-of select="substring($date, 0, 5)"/>
</xsl:element>
<xsl:element name="{$dateType}MonthForResource">
<xsl:value-of select="substring($zuluDateTime, 0, 8)"/>
<xsl:value-of select="substring($date, 0, 8)"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,16 @@

<xsl:choose>
<xsl:when test="$zuluDateTime != ''">
<!-- Store original date information for the resource, instead of $zuluDateTime,
to avoid timezone shifts when used for facet filters -->
<xsl:element name="{$dateType}DateForResource">
<xsl:value-of select="$zuluDateTime"/>
<xsl:value-of select="$date"/>
</xsl:element>
<xsl:element name="{$dateType}YearForResource">
<xsl:value-of select="substring($zuluDateTime, 0, 5)"/>
<xsl:value-of select="substring($date, 0, 5)"/>
</xsl:element>
<xsl:element name="{$dateType}MonthForResource">
<xsl:value-of select="substring($zuluDateTime, 0, 8)"/>
<xsl:value-of select="substring($date, 0, 8)"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
Expand Down

0 comments on commit 8436990

Please sign in to comment.