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 committed Sep 12, 2024
1 parent c2a3f5f commit d2cca2a
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 d2cca2a

Please sign in to comment.