xsl/ical: prepend VALUE=DATE to dates without time as per RFC5545
This commit is contained in:
parent
9cf22a7b68
commit
2dd31fefd7
38
xsl/ical.xsl
38
xsl/ical.xsl
|
@ -80,7 +80,15 @@
|
|||
</xsl:template>
|
||||
|
||||
<xsl:template match="start">
|
||||
<xsl:text>DTSTART:</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(., 'T')">
|
||||
<xsl:text>DTSTART:</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>DTSTART;VALUE=DATE:</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:call-template name="date-to-hevent">
|
||||
<xsl:with-param name="date" select="string(.)"/>
|
||||
</xsl:call-template>
|
||||
|
@ -90,19 +98,25 @@
|
|||
<xsl:template match="end">
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(string(.) = string(../start))">
|
||||
<xsl:text>DTEND:</xsl:text>
|
||||
<xsl:call-template name="date-to-hevent">
|
||||
<xsl:with-param name="date">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(., 'T')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(., 'T')">
|
||||
<xsl:text>DTEND:</xsl:text>
|
||||
<xsl:call-template name="date-to-hevent">
|
||||
<xsl:with-param name="date">
|
||||
<xsl:value-of select="string(.)"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</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:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
|
|
Loading…
Reference in New Issue