[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-www
Subject:    Re: http://www.freebsd.org/events/events.ics
From:       Ceri Davies <ceri () submonkey ! net>
Date:       2006-08-07 12:20:11
Message-ID: C0FCEE8B.12C17%ceri () submonkey ! net
[Download RAW message or body]

On 6/8/06 00:14, "Johann Tonsing" <jtonsing@fastmail.fm> wrote:

> The icalendar file states that the come2linux event occurs only on 9
> September 2006.  Kindly adjust the file to indicate that it occurs from
> 9 to 10 September 2006.

There's a longstanding bug in the icalendar generator that has all multi-day
events ending a day early.  Details attached; I still don't know how to fix
it.  Anyone?

Ceri
-- 
That must be wonderful!  I don't understand it at all.
                                      -- Moliere



[Attachment #3 (message/rfc822)]



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=URI:http://2005.eurobsdcon.org/
LOCATION:University of Basel, Basel, Switzerland
DTSTART;VALUE=DATE:20051125
DTEND;VALUE=DATE: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 == February && year != leapyear && day == 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="gen-ical-date-interval">
    <xsl:param name="startdate"/>
    <xsl:param name="enddate"/>

DTSTART;VALUE=DATE:<xsl:value-of select="concat(startdate/year,
	    format-number(startdate/month, '00'),
	    format-number(startdate/day, '00'))"/>

    <xsl:if test="number(startdate/month) != number(enddate/month) or
		  number(startdate/day) != number(enddate/day) or
		  number(startdate/year) != number(enddate/year)">
DTEND;VALUE=DATE:<xsl:value-of select="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="gen-ical-date-interval">
    <xsl:param name="startdate"/>
    <xsl:param name="enddate"/>

DTSTART;VALUE=DATE:<xsl:value-of select="concat(startdate/year,
	    format-number(startdate/month, '00'),
	    format-number(startdate/day, '00'))"/>

    <xsl:if test="number(startdate/month) != number(enddate/month) or
		  number(startdate/day) != number(enddate/day) or
		  number(startdate/year) != number(enddate/year)">
DTEND;VALUE=DATE:<xsl:call-template select="date-plus-one-day">
	  <xsl:with-param value="enddate" />
	</xsl:call-template>

     </xsl:if>
  </xsl:template>

and I need help writing the "date-plus-one-day" template.

Cheers,

Ceri
-- 
Only two things are infinite, the universe and human stupidity, and I'm
not sure about the former.			  -- Einstein (attrib.)

[Attachment #6 (application/pgp-signature)]

_______________________________________________
freebsd-www@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-www
To unsubscribe, send any mail to "freebsd-www-unsubscribe@freebsd.org"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic