Date: Wed, 28 Sep 2005 20:42:05 +0100 From: Ceri Davies <ceri@submonkey.net> To: www@FreeBSD.org Subject: Bug in events2ics.xml: calling out for a (XSL) hero Message-ID: <20050928194205.GQ94010@submonkey.net>
next in thread | raw e-mail | index | archive | help
--Nj4mAaUCx+wbOcQD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable There is a bug in events2ics.xsl; an event lasting a number of days must have its end date set to the date after it ends in order to be shown correctly by a client. For example, EuroBSDCon starts on November 25th and ends on November 27th, so should have an event entry like this: BEGIN:VEVENT SEQUENCE:1 SUMMARY:EuroBSDCon 2005 URL;VALUE=3DURI:http://2005.eurobsdcon.org/ LOCATION:University of Basel, Basel, Switzerland DTSTART;VALUE=3DDATE:20051125 DTEND;VALUE=3DDATE:20051128 DESCRIPTION:The fourth annual European BSD Conference. It is... END:VEVENT However, the current implementation puts 20051127 in the date entry. To fix this, I need to implement a "date-plus-one-day" template, and I don't know how to do it. If anyone does, please let me know. If the correct fix is a whole mess of "if (month =3D=3D February && year !=3D leapyear && day =3D=3D 28) then = {day++, month++}" and so on then I can do that; just tell me to do it. To clarify for anyone still willing to help, the relevant part of events2ics.xsl is: <!-- Generate iCalendar DTSTART and DTEND entries --> <xsl:template name=3D"gen-ical-date-interval"> <xsl:param name=3D"startdate"/> <xsl:param name=3D"enddate"/> DTSTART;VALUE=3DDATE:<xsl:value-of select=3D"concat(startdate/year, format-number(startdate/month, '00'), format-number(startdate/day, '00'))"/> <xsl:if test=3D"number(startdate/month) !=3D number(enddate/month) or number(startdate/day) !=3D number(enddate/day) or number(startdate/year) !=3D number(enddate/year)"> DTEND;VALUE=3DDATE:<xsl:value-of select=3D"concat(enddate/year, format-number(enddate/month, '00'), format-number(enddate/day, '00'))"/> </xsl:if> </xsl:template> I need to replace this template with: <!-- Generate iCalendar DTSTART and DTEND entries --> <xsl:template name=3D"gen-ical-date-interval"> <xsl:param name=3D"startdate"/> <xsl:param name=3D"enddate"/> DTSTART;VALUE=3DDATE:<xsl:value-of select=3D"concat(startdate/year, format-number(startdate/month, '00'), format-number(startdate/day, '00'))"/> <xsl:if test=3D"number(startdate/month) !=3D number(enddate/month) or number(startdate/day) !=3D number(enddate/day) or number(startdate/year) !=3D number(enddate/year)"> DTEND;VALUE=3DDATE:<xsl:call-template select=3D"date-plus-one-day"> <xsl:with-param value=3D"enddate" /> </xsl:call-template> </xsl:if> </xsl:template> and I need help writing the "date-plus-one-day" template. Cheers, Ceri --=20 Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -- Einstein (attrib.) --Nj4mAaUCx+wbOcQD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDOvINocfcwTS3JF8RAqGNAJ92hF5lHyDnNQYgq6E5Eqke7XfXuACgmZHQ uPoqSm1e/ReXm9Z7CI3IBfo= =WOBa -----END PGP SIGNATURE----- --Nj4mAaUCx+wbOcQD--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050928194205.GQ94010>