Calendar: Support dates spanning multiple days

git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@548 31f61c52-7bfb-0310-b897-fc00f8a278f0
This commit is contained in:
astro 2006-11-09 23:41:41 +00:00
parent e3b6b406cf
commit 581b4f7dbf
3 changed files with 24 additions and 3 deletions

View File

@ -27,4 +27,10 @@
<location>global</location>
<link>http://de.wikipedia.org/wiki/Kauf-Nix-Tag</link>
</event>
<event title="23C3">
<start>2006-12-27</start>
<end>2006-12-30</end>
<location>Berlin</location>
<link>http://www.ccc.de/congress/</link>
</event>
</calendar>

View File

@ -39,7 +39,17 @@
</xsl:otherwise>
</xsl:choose>
</title>
<date><xsl:value-of select="start"/></date>
<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>

View File

@ -73,8 +73,13 @@
</span>
<ul>
<xsl:for-each select="event">
<xsl:sort select="date"/>
<xsl:if test="concat(date:year($date),'-',date:month-in-year($date),'-',date:day-in-month($date)) = concat(date:year(date),'-',date:month-in-year(date),'-',date:day-in-month(date))">
<xsl:sort select="start"/>
<xsl:variable name="start" select="concat(format-number(date:year(start),'00'),format-number(date:month-in-year(start),'00'),format-number(date:day-in-month(start),'00'))"/>
<xsl:variable name="end" select="concat(format-number(date:year(end),'00'),format-number(date:month-in-year(end),'00'),format-number(date:day-in-month(end),'00'))"/>
<xsl:variable name="date" select="concat(format-number(date:year($date),'00'),format-number(date:month-in-year($date),'00'),format-number(date:day-in-month($date),'00'))"/>
<xsl:if test="($start &lt;= $date) and ($date &lt;= $end)">
<li>
<a href="{link}">
<xsl:value-of select="title"/>