Subject: RE: Mixed Date / Date-Time values.

From: Doug Royer <[email-masked]>
Date: Tue, 17 Aug 1999 17:23:27 -0700 (PDT)

> From: "Greg FitzPatrick" <[email-masked]>
> Date: Wed, 18 Aug 1999 00:33:57 +0200
>
> Sorry if this is considered closed, but I would like to get your opinion as
> to whether this would not exacerbate our(supposed) problem with defining
> opening times by the use of RRULE and EXRULES and RDATES and XDATES.
> 
> Several people in Oslo offered to do some examples. Is there any volunteer
> who would still like to describe the following Opening Times using RFC 2445.
> 
> This is Sam's bakery's opening times for the year 2000 and onward.
> 

> Sam's bakery is open from 7 to 12 and 13 to 18, Monday through Thursday.
> (They close for lunch between 12 and 13)
> Sam's is open from 7 to 12 and 13 to 15.30  on Fridays
> Sam's is open from 9 to 13 on Saturdays
> Sam's is closed on Sundays
> Sam's does not open on Saturdays during the period of July 5 to August 5
> Sam shuts down on the following holidays;  Jan 1, Feb, 12 July 9, Oct 8, Dec
> 24, 25

I am not including other mandatory properties to keep this example clean.

Keep in mind that iCalendar is an INTEROPERABILITY object. Not
the way you must store the data. So this may look long. But
it does the job and that is the point of iCalendar. 

I think the following does the job for 'Sam' (Others - PLEASE
check my work - I did this 'off of the top of my head' and I
have not run this through a parser or syntax checker. Here
is the one VCALENDAR object that describes what I think you said:

	BEGIN:VCALENDAR

	BEGIN:VEVENT
	UID:SAM-1
	RELATED-TO;RELTYPE=SIBLING:SAM-2,SAM-3,SAM-4
	DTSTART:20000101T070000
	DTEND:20000101T120000
	RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
	EXRULE:FREQ=WEEKL;BYMONTH=7;BYDAY=SA;BYSETPOS=5,6,7,8,9,10,11,12,13,
	 14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
 	EXRULE:FREQ=DAILY;BYMONTH=8;BYDAY=SA;BYSETPOS=1,2,3,4,5
 	EXRULE:FREQ=YEARLY;BYMONTH=1;BYSETPOS=1
 	EXRULE:FREQ=YEARLY;BYMONTH=2;BYSETPOS=12
 	EXRULE:FREQ=YEARLY;BYMONTH=7;BYSETPOS=9
 	EXRULE:FREQ=YEARLY;BYMONTH=9;BYSETPOS=8
 	EXRULE:FREQ=YEARLY;BYMONTH=12;BYSETPOS=25,24
	END:VEVENT

	BEGIN:VEVENT
	UID:SAM-2
	RELATED-TO;RELTYPE=SIBLING:SAM-1,SAM-3,SAM-4
	DTSTART:20000101T130000
	DTEND:20000101T180000
	RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH
	EXRULE:FREQ=WEEKL;BYMONTH=7;BYDAY=SA;BYSETPOS=5,6,7,8,9,10,11,12,13,
	 14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
 	EXRULE:FREQ=DAILY;BYMONTH=8;BYDAY=SA;BYSETPOS=1,2,3,4,5
 	EXRULE:FREQ=YEARLY;BYMONTH=1;BYSETPOS=1
 	EXRULE:FREQ=YEARLY;BYMONTH=2;BYSETPOS=12
 	EXRULE:FREQ=YEARLY;BYMONTH=7;BYSETPOS=9
 	EXRULE:FREQ=YEARLY;BYMONTH=9;BYSETPOS=8
 	EXRULE:FREQ=YEARLY;BYMONTH=12;BYSETPOS=25,24
	END:VEVENT

	BEGIN:VEVENT
	UID:SAM-3
	RELATED-TO;RELTYPE=SIBLING:SAM-1,SAM-2,SAM-4
	DTSTART:20000101T090000
	DTEND:20000101T130000
	RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH
	EXRULE:FREQ=WEEKL;BYMONTH=7;BYDAY=SA;BYSETPOS=5,6,7,8,9,10,11,12,13,
	 14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
 	EXRULE:FREQ=DAILY;BYMONTH=8;BYDAY=SA;BYSETPOS=1,2,3,4,5
 	EXRULE:FREQ=YEARLY;BYMONTH=1;BYSETPOS=1
 	EXRULE:FREQ=YEARLY;BYMONTH=2;BYSETPOS=12
 	EXRULE:FREQ=YEARLY;BYMONTH=7;BYSETPOS=9
 	EXRULE:FREQ=YEARLY;BYMONTH=9;BYSETPOS=8
 	EXRULE:FREQ=YEARLY;BYMONTH=12;BYSETPOS=25,24
	END:VEVENT

	BEGIN:VEVENT
	UID:SAM-4
	RELATED-TO;RELTYPE=SIBLING:SAM-1,SAM-2,SAM-3
	DTSTART:20000101T130000
	DTEND:20000101T153000
	RRULE:FREQ=WEEKLY;BYDAY=FR
	EXRULE:FREQ=WEEKL;BYMONTH=7;BYDAY=SA;BYSETPOS=5,6,7,8,9,10,11,12,13,
	 14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
 	EXRULE:FREQ=DAILY;BYMONTH=8;BYDAY=SA;BYSETPOS=1,2,3,4,5
 	EXRULE:FREQ=YEARLY;BYMONTH=1;BYSETPOS=1
 	EXRULE:FREQ=YEARLY;BYMONTH=2;BYSETPOS=12
 	EXRULE:FREQ=YEARLY;BYMONTH=7;BYSETPOS=9
 	EXRULE:FREQ=YEARLY;BYMONTH=9;BYSETPOS=8
 	EXRULE:FREQ=YEARLY;BYMONTH=12;BYSETPOS=25,24
	END:VEVENT
	
	END:VCALENDAR

> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]]On
> Behalf Of [email-masked]
> Sent: den 3 augusti 1999 23:41
> To: [email-masked]
> Subject: Re: Mixed Date / Date-Time values.
> 
> 
> 
> Can we mark this issue closed?
> The value types for DTSTART, DTEND, DUE, RDATE, EXDATE, RRULE/EXRULE (for
> UNTIL value components) MUST match types.
> 
> This will be filed as a RFC 2445 change request for the DESCRIPTION portion
> of these property definitions.
> 
> -- Frank
> 
> 
> 
> 

-Doug
-------------------------------------------------------------------
[email-masked]		http://playground.sun.com/~dougr
Pager:				[email-masked]
801 W. El Camino #131		Work:   (650)786-7599
Mountain View, CA 94040		Ham Radio: N6AAW, Aviation: PP-ASEL

---

From: [email-masked]
Date: Wed, 18 Aug 1999 14:32:51 GMT

>Sam shuts down on the following holidays;  Jan 1, Feb, 12 July 9, Oct 8, 
Dec

FYI. I think you mean EXDATE, not EDATE in your original note.
The easiest way to represent these store hours is to define separate 
VEVENTs and relate them using the RELATED-TO property. How about this 
using four events, one for the weekday morning store hours, a second for 
the weekday MO-TH afternoon store hours, a third for the weekday FR 
afternoon store hours and a fourth for the weekend store hours. 
Interesting, this is very much the same way that the store hours would be 
listed on the front door or on a website for the store! Actually, it is 
VERY important to keep the store hours as separate VEVENTS, as there will 
most probably be different store help for each. Your know the quirks of 
these unions ;-) In addition, if you copy the events on to the employee's 
work calendars you will want them as separate events. Bill won't want to 
see he is working the weekend when he has a hot date with Sally! There are 
probably other good reasons to have these as separate but linked/related 
events too.
BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
DTSTAMP:19990101T100000Z
UID:123
DTSTART;TZID=US/Eastern:19990104T070000
DTEND;TZID=US/Eastern:19990104T120000
SUMMARY:Sam's Bakery Weekday Morning Hours
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
EXDATE:19990101,19990212,19990709,19991008,19991224,19991225
RELATED-TO;RELTYPE=SIBLING:124
RELATED-TO;RELTYPE=SIBLING:125
RELATED-TO;RELTYPE=SIBLING:126
END:VEVENT
BEGIN:VEVENT
DTSTAMP:19990101T100001Z
UID:124
DTSTART;TZID=US/Eastern:19990104T130000
DTEND;TZID=US/Eastern:19990104T180000
SUMMARY:Sam's Bakery MO-TH Afternoon Hours
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH
EXDATE:19990101,19990212,19990709,19991008,19991224,19991225
RELATED-TO;RELTYPE=SIBLING:123
RELATED-TO;RELTYPE=SIBLING:125
RELATED-TO;RELTYPE=SIBLING:126
END:VEVENT
BEGIN:VEVENT
DTSTAMP:19990101T100001Z
UID:125
DTSTART;TZID=US/Eastern:19990101T130000
DTEND;TZID=US/Eastern:19990101T183000
SUMMARY:Sam's Bakery FR Afternoon Hours
RRULE:FREQ=WEEKLY;BYDAY=FR
EXDATE:19990101,19990212,19990709,19991008,19991224,19991225
RELATED-TO;RELTYPE=SIBLING:123
RELATED-TO;RELTYPE=SIBLING:125
RELATED-TO;RELTYPE=SIBLING:126
END:VEVENT
BEGIN:VEVENT
DTSTAMP:19990101T100001Z
UID:126
DTSTART;TZID=US/Eastern:19990102T090000
DTEND;TZID=US/Eastern:19990102T130000
SUMMARY:Sam's Bakery Weekend Hours
DESCRIPTION:NOTE: We are closed SUNDAYS.\n   We will also
  be closed on Saturdays, from July 5 through August 5.\n
 We hope you enjoy your summer holidays also! -- Sam's
RRULE:FREQ=WEEKLY;BYDAY=SA
EXDATE:19990101,19990212,19990709,19991008,19991224,19991225
EXDATE:19990710,19990717,19990724,19990731
RELATED-TO;RELTYPE=SIBLING:123
RELATED-TO;RELTYPE=SIBLING:124
RELATED-TO;RELTYPE=SIBLING:125
END:VEVENT
END:VCALENDAR
One thing this exercise does point out is that it would have been very 
useful to have a ";START=" RECUR value, rule component. This would have 
been useful in the EXRULE definition for the Saturday close dates. For 
example, with this enhancement:
EXRULE:FREQ=WEEKLY;BYDAY=SA;START=19990710;UNTIL=19990805
Maybe Doug Royer could add this to his issues list?
-- Frank