xsl/calendar-summary: skip events older than 1 year
should speed up build process by muchds2013
parent
e6fff13329
commit
2ca0fcf4f7
|
@ -29,36 +29,40 @@
|
|||
<xsl:template match="event">
|
||||
<xsl:param name="link"/>
|
||||
|
||||
<event>
|
||||
<title>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
|
||||
<xsl:when test="../@title"><xsl:value-of select="../@title"/></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:message terminate="yes">Event with no title!</xsl:message>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</title>
|
||||
<start><xsl:value-of select="start"/></start>
|
||||
<end>
|
||||
<xsl:choose>
|
||||
<xsl:when test="end">
|
||||
<xsl:value-of select="end"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="start"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</end>
|
||||
<location><xsl:value-of select="location"/></location>
|
||||
<link>
|
||||
<xsl:choose>
|
||||
<xsl:when test="link"><xsl:value-of select="link"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$link"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</link>
|
||||
<!-- TODO: Link -->
|
||||
</event>
|
||||
<!-- Events must have started at least one year ago -->
|
||||
<xsl:variable name="minstart" select="date:add(date:date-time(), '-P366D')"/>
|
||||
<xsl:if test="starts-with(date:difference(start, $minstart), '-')">
|
||||
<event>
|
||||
<title>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
|
||||
<xsl:when test="../@title"><xsl:value-of select="../@title"/></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:message terminate="yes">Event with no title!</xsl:message>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</title>
|
||||
<start><xsl:value-of select="start"/></start>
|
||||
<end>
|
||||
<xsl:choose>
|
||||
<xsl:when test="end">
|
||||
<xsl:value-of select="end"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="start"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</end>
|
||||
<location><xsl:value-of select="location"/></location>
|
||||
<link>
|
||||
<xsl:choose>
|
||||
<xsl:when test="link"><xsl:value-of select="link"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$link"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</link>
|
||||
<!-- TODO: Link -->
|
||||
</event>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
Loading…
Reference in New Issue