xsl/ical: properly prepend VALUE=DATE to dates without time as per RFC5545

This commit is contained in:
Astro 2016-09-06 21:12:54 +02:00
parent 34fca83df1
commit 7cbf3828c7
1 changed files with 20 additions and 11 deletions

View File

@ -98,22 +98,31 @@
<xsl:template match="end">
<xsl:choose>
<xsl:when test="not(string(.) = string(../start))">
<xsl:choose>
<xsl:when test="contains(., 'T')">
<xsl:text>DTEND:</xsl:text>
<xsl:variable name="date">
<xsl:call-template name="date-to-hevent">
<xsl:with-param name="date">
<xsl:choose>
<xsl:when test="contains(., 'T')">
<xsl:value-of select="string(.)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="date:add(., 'P1D')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($date, 'T')">
<xsl:text>DTEND:</xsl:text>
<xsl:value-of select="$date"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>DTEND;VALUE=DATE:</xsl:text>
<xsl:call-template name="date-to-hevent">
<xsl:with-param name="date">
<xsl:value-of select="date:add(., 'P1D')"/>
</xsl:with-param>
</xsl:call-template>
<xsl:value-of select="$date"/>
</xsl:otherwise>
</xsl:choose>