xsl/ddate: fix discordian holidays in leap years

This commit is contained in:
Astro 2012-05-03 17:10:33 +02:00
parent 1ed8bf977a
commit 9be6f6198e

View File

@ -66,7 +66,16 @@
<xsl:template name="ddate-holiday">
<xsl:param name="date"/>
<xsl:variable name="yday" select="date:day-in-year($date)"/>
<xsl:variable name="yday">
<xsl:choose>
<xsl:when test="date:leap-year($date) and date:month-in-year($date) &gt; 2">
<xsl:value-of select="date:day-in-year($date) - 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="date:day-in-year($date)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="mday" select="(($yday - 1) mod 73) + 1"/>
<xsl:variable name="season" select="floor(($yday - 1) div 73) + 1"/>