1 -- --------------------------------------------------------------------
2 -- This file is a set of tests for the RRULE sql functions taken from
3 -- the examples in RFC2445 section 4.8.5.4
4 -- --------------------------------------------------------------------
5 -- --------------------------------------------------------------------
6 -- Daily for 10 occurrences:
8 -- DTSTART;TZID=US-Eastern:19970902T090000
9 -- RRULE:FREQ=DAILY;COUNT=10
11 -- ==> (1997 9:00 AM EDT)September 2-11
12 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=DAILY;COUNT=10' );
14 -- --------------------------------------------------------------------
15 -- Daily until December 24, 1997:
17 -- DTSTART;TZID=US-Eastern:19970902T090000
18 -- RRULE:FREQ=DAILY;UNTIL=19971224T000000Z
20 -- ==> (1997 9:00 AM EDT)September 2-30;October 1-25
21 -- (1997 9:00 AM EST)October 26-31;November 1-30;December 1-23
22 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=DAILY;UNTIL=19971224T000000' );
24 -- --------------------------------------------------------------------
25 -- Every other day - forever:
27 -- DTSTART;TZID=US-Eastern:19970902T090000
28 -- RRULE:FREQ=DAILY;INTERVAL=2
29 -- ==> (1997 9:00 AM EDT)September2,4,6,8...24,26,28,30;
30 -- October 2,4,6...20,22,24
31 -- (1997 9:00 AM EST)October 26,28,30;November 1,3,5,7...25,27,29;
34 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=DAILY;INTERVAL=2' ) LIMIT 50;
35 -- --------------------------------------------------------------------
36 -- Every 10 days, 5 occurrences:
38 -- DTSTART;TZID=US-Eastern:19970902T090000
39 -- RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5
41 -- ==> (1997 9:00 AM EDT)September 2,12,22;October 2,12
43 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=DAILY;INTERVAL=10;COUNT=5' );
44 -- --------------------------------------------------------------------
45 -- Everyday in January, for 3 years:
47 -- DTSTART;TZID=US-Eastern:19980101T090000
48 -- RRULE:FREQ=YEARLY;UNTIL=20000131T090000Z;
49 -- BYMONTH=1;BYDAY=SU,MO,TU,WE,TH,FR,SA
51 -- RRULE:FREQ=DAILY;UNTIL=20000131T090000Z;BYMONTH=1
53 -- ==> (1998 9:00 AM EDT)January 1-31
54 -- (1999 9:00 AM EDT)January 1-31
55 -- (2000 9:00 AM EDT)January 1-31
57 --- ? No instance on January 31, since 9:00am EDT is after 2000-01-31 09:00:00 UTC. I think that is correct.
58 --- ? SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19980101T090000', 'FREQ=YEARLY;UNTIL=20000131T090000Z;BYMONTH=1;BYDAY=SU,MO,TU,WE,TH,FR,SA' );
59 --- ? No instance on January 31, since 9:00am EDT is after 2000-01-31 09:00:00 UTC. I think that is correct.
60 --- ? SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19980101T090000', 'FREQ=DAILY;UNTIL=20000131T090000Z;BYMONTH=1' );
61 -- --------------------------------------------------------------------
62 -- Weekly for 10 occurrences
64 -- DTSTART;TZID=US-Eastern:19970902T090000
65 -- RRULE:FREQ=WEEKLY;COUNT=10
67 -- ==> (1997 9:00 AM EDT)September 2,9,16,23,30;October 7,14,21
68 -- (1997 9:00 AM EST)October 28;November 4
69 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=WEEKLY;COUNT=10' );
71 -- --------------------------------------------------------------------
72 -- Weekly until December 24, 1997
74 -- DTSTART;TZID=US-Eastern:19970902T090000
75 -- RRULE:FREQ=WEEKLY;UNTIL=19971224T000000Z
77 -- ==> (1997 9:00 AM EDT)September 2,9,16,23,30;October 7,14,21
78 -- (1997 9:00 AM EST)October 28;November 4,11,18,25;
80 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=WEEKLY;UNTIL=19971224T000000Z' );
82 -- --------------------------------------------------------------------
83 -- Every other week - forever:
85 -- DTSTART;TZID=US-Eastern:19970902T090000
86 -- RRULE:FREQ=WEEKLY;INTERVAL=2;WKST=SU
88 -- ==> (1997 9:00 AM EDT)September 2,16,30;October 14
89 -- (1997 9:00 AM EST)October 28;November 11,25;December 9,23
90 -- (1998 9:00 AM EST)January 6,20;February 3, 17
92 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=WEEKLY;INTERVAL=2;WKST=SU' ) LIMIT 13;
94 -- --------------------------------------------------------------------
95 -- Weekly on Tuesday and Thursday for 5 weeks:
97 -- DTSTART;TZID=US-Eastern:19970902T090000
98 -- RRULE:FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH
100 -- RRULE:FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH
102 -- ==> (1997 9:00 AM EDT)September 2,4,9,11,16,18,23,25,30;October 2
103 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH' );
104 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH' );
106 -- --------------------------------------------------------------------
107 -- Every other week on Monday, Wednesday and Friday until December 24,
108 -- 1997, but starting on Tuesday, September 2, 1997:
110 -- DTSTART;TZID=US-Eastern:19970902T090000
111 -- RRULE:FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;
113 -- ==> (1997 9:00 AM EDT)September 2,3,5,15,17,19,29;October
115 -- (1997 9:00 AM EST)October 27,29,31;November 10,12,14,24,26,28;
116 -- December 8,10,12,22
117 -- !!! This is challenging, because it starts on DTSTART even though DTSTART fails the repeat criteria. In fact no known provide a UI that allows data like this to be created.
118 --- !!! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR' );
120 -- --------------------------------------------------------------------
121 -- Every other week on Tuesday and Thursday, for 8 occurrences:
123 -- DTSTART;TZID=US-Eastern:19970902T090000
124 -- RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=8;WKST=SU;BYDAY=TU,TH
126 -- ==> (1997 9:00 AM EDT)September 2,4,16,18,30;October 2,14,16
127 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=WEEKLY;INTERVAL=2;COUNT=8;WKST=SU;BYDAY=TU,TH' );
129 -- --------------------------------------------------------------------
130 -- Monthly on the 1st Friday for ten occurrences:
132 -- DTSTART;TZID=US-Eastern:19970905T090000
133 -- RRULE:FREQ=MONTHLY;COUNT=10;BYDAY=1FR
135 -- ==> (1997 9:00 AM EDT)September 5;October 3
136 -- (1997 9:00 AM EST)November 7;Dec 5
137 -- (1998 9:00 AM EST)January 2;February 6;March 6;April 3
138 -- (1998 9:00 AM EDT)May 1;June 5
139 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970905T090000', 'FREQ=MONTHLY;COUNT=10;BYDAY=1FR' );
141 -- --------------------------------------------------------------------
142 -- Monthly on the 1st Friday until December 24, 1997:
144 -- DTSTART;TZID=US-Eastern:19970905T090000
145 -- RRULE:FREQ=MONTHLY;UNTIL=19971224T000000Z;BYDAY=1FR
147 -- ==> (1997 9:00 AM EDT)September 5;October 3
148 -- (1997 9:00 AM EST)November 7;December 5
149 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970905T090000', 'FREQ=MONTHLY;UNTIL=19971224T000000Z;BYDAY=1FR' );
151 -- --------------------------------------------------------------------
152 -- Every other month on the 1st and last Sunday of the month for 10
155 -- DTSTART;TZID=US-Eastern:19970907T090000
156 -- RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU
158 -- ==> (1997 9:00 AM EDT)September 7,28
159 -- (1997 9:00 AM EST)November 2,30
160 -- (1998 9:00 AM EST)January 4,25;March 1,29
161 -- (1998 9:00 AM EDT)May 3,31
162 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970907T090000', 'FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU' );
164 -- --------------------------------------------------------------------
165 -- Monthly on the second to last Monday of the month for 6 months:
167 -- DTSTART;TZID=US-Eastern:19970922T090000
168 -- RRULE:FREQ=MONTHLY;COUNT=6;BYDAY=-2MO
170 -- ==> (1997 9:00 AM EDT)September 22;October 20
171 -- (1997 9:00 AM EST)November 17;December 22
172 -- (1998 9:00 AM EST)January 19;February 16
173 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=MONTHLY;COUNT=6;BYDAY=-2MO' );
175 -- --------------------------------------------------------------------
176 -- Monthly on the third to the last day of the month, forever:
178 -- DTSTART;TZID=US-Eastern:19970928T090000
179 -- RRULE:FREQ=MONTHLY;BYMONTHDAY=-3
181 -- ==> (1997 9:00 AM EDT)September 28
182 -- (1997 9:00 AM EST)October 29;November 28;December 29
183 -- (1998 9:00 AM EST)January 29;February 26
185 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=MONTHLY;BYMONTHDAY=-3' ) LIMIT 6;
187 -- --------------------------------------------------------------------
188 -- Monthly on the 2nd and 15th of the month for 10 occurrences:
190 -- DTSTART;TZID=US-Eastern:19970902T090000
191 -- RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=2,15
193 -- ==> (1997 9:00 AM EDT)September 2,15;October 2,15
194 -- (1997 9:00 AM EST)November 2,15;December 2,15
195 -- (1998 9:00 AM EST)January 2,15
196 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=MONTHLY;COUNT=10;BYMONTHDAY=2,15' );
198 -- --------------------------------------------------------------------
199 -- Monthly on the first and last day of the month for 10 occurrences:
201 -- DTSTART;TZID=US-Eastern:19970930T090000
202 -- RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=1,-1
204 -- ==> (1997 9:00 AM EDT)September 30;October 1
205 -- (1997 9:00 AM EST)October 31;November 1,30;December 1,31
206 -- (1998 9:00 AM EST)January 1,31;February 1
207 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970930T090000', 'FREQ=MONTHLY;COUNT=10;BYMONTHDAY=1,-1' );
209 -- --------------------------------------------------------------------
210 -- Every 18 months on the 10th thru 15th of the month for 10
213 -- DTSTART;TZID=US-Eastern:19970910T090000
214 -- RRULE:FREQ=MONTHLY;INTERVAL=18;COUNT=10;BYMONTHDAY=10,11,12,13,14,
217 -- ==> (1997 9:00 AM EDT)September 10,11,12,13,14,15
218 -- (1999 9:00 AM EST)March 10,11,12,13
219 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970910T090000', 'FREQ=MONTHLY;INTERVAL=18;COUNT=10;BYMONTHDAY=10,11,12,13,14,15' );
221 -- --------------------------------------------------------------------
222 -- Every Tuesday, every other month:
224 -- DTSTART;TZID=US-Eastern:19970902T090000
225 -- RRULE:FREQ=MONTHLY;INTERVAL=2;BYDAY=TU
227 -- ==> (1997 9:00 AM EDT)September 2,9,16,23,30
228 -- (1997 9:00 AM EST)November 4,11,18,25
229 -- (1998 9:00 AM EST)January 6,13,20,27;March 3,10,17,24,31
231 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=MONTHLY;INTERVAL=2;BYDAY=TU' ) LIMIT 18;
233 -- --------------------------------------------------------------------
234 -- Yearly in June and July for 10 occurrences:
236 -- DTSTART;TZID=US-Eastern:19970610T090000
237 -- RRULE:FREQ=YEARLY;COUNT=10;BYMONTH=6,7
238 -- ==> (1997 9:00 AM EDT)June 10;July 10
239 -- (1998 9:00 AM EDT)June 10;July 10
240 -- (1999 9:00 AM EDT)June 10;July 10
241 -- (2000 9:00 AM EDT)June 10;July 10
242 -- (2001 9:00 AM EDT)June 10;July 10
243 -- Note: Since none of the BYDAY, BYMONTHDAY or BYYEARDAY components
244 -- are specified, the day is gotten from DTSTART
245 --- !!! We miss the first instance in June. Busted.
246 --- !!! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970610T090000', 'FREQ=YEARLY;COUNT=10;BYMONTH=6,7' );
248 -- --------------------------------------------------------------------
249 -- Every other year on January, February, and March for 10 occurrences:
251 -- DTSTART;TZID=US-Eastern:19970310T090000
252 -- RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3
254 -- ==> (1997 9:00 AM EST)March 10
255 -- (1999 9:00 AM EST)January 10;February 10;March 10
256 -- (2001 9:00 AM EST)January 10;February 10;March 10
257 -- (2003 9:00 AM EST)January 10;February 10;March 10
258 --- !!! We miss the first instance in March. Busted.
259 --- !!! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970310T090000', 'FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3' );
261 -- --------------------------------------------------------------------
262 -- Every 3rd year on the 1st, 100th and 200th day for 10 occurrences:
264 -- DTSTART;TZID=US-Eastern:19970101T090000
265 -- RRULE:FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200
267 -- ==> (1997 9:00 AM EST)January 1
268 -- (1997 9:00 AM EDT)April 10;July 19
269 -- (2000 9:00 AM EST)January 1
270 -- (2000 9:00 AM EDT)April 9;July 18
271 -- (2003 9:00 AM EST)January 1
272 -- (2003 9:00 AM EDT)April 10;July 19
273 -- (2006 9:00 AM EST)January 1
274 --- ! We don't support BYYEARDAY yet.
275 --- ! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970101T090000', 'FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200' );
277 -- --------------------------------------------------------------------
278 -- Every 20th Monday of the year, forever:
279 -- DTSTART;TZID=US-Eastern:19970519T090000
280 -- RRULE:FREQ=YEARLY;BYDAY=20MO
282 -- ==> (1997 9:00 AM EDT)May 19
283 -- (1998 9:00 AM EDT)May 18
284 -- (1999 9:00 AM EDT)May 17
286 --- ! We don't support BYDAY for yearly events. We don't support YEARLY at all well, TBH
287 --- ! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970519T090000', 'FREQ=YEARLY;BYDAY=20MO' ) LIMIT 3;
289 -- --------------------------------------------------------------------
290 -- Monday of week number 20 (where the default start of the week is
293 -- DTSTART;TZID=US-Eastern:19970512T090000
294 -- RRULE:FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO
296 -- ==> (1997 9:00 AM EDT)May 12
297 -- (1998 9:00 AM EDT)May 11
298 -- (1999 9:00 AM EDT)May 17
300 --- ! We don't support BYWEEKNO at all yet.
301 --- ! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970512T090000', 'FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO' ) LIMIT 3;
303 -- --------------------------------------------------------------------
304 -- Every Thursday in March, forever:
306 -- DTSTART;TZID=US-Eastern:19970313T090000
307 -- RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=TH
309 -- ==> (1997 9:00 AM EST)March 13,20,27
310 -- (1998 9:00 AM EST)March 5,12,19,26
311 -- (1999 9:00 AM EST)March 4,11,18,25
313 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970313T090000', 'FREQ=YEARLY;BYMONTH=3;BYDAY=TH' ) LIMIT 11;
315 -- --------------------------------------------------------------------
316 -- Every Thursday, but only during June, July, and August, forever:
318 -- DTSTART;TZID=US-Eastern:19970605T090000
319 -- RRULE:FREQ=YEARLY;BYDAY=TH;BYMONTH=6,7,8
321 -- ==> (1997 9:00 AM EDT)June 5,12,19,26;July 3,10,17,24,31;
323 -- (1998 9:00 AM EDT)June 4,11,18,25;July 2,9,16,23,30;
325 -- (1999 9:00 AM EDT)June 3,10,17,24;July 1,8,15,22,29;
328 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970605T090000', 'FREQ=YEARLY;BYDAY=TH;BYMONTH=6,7,8' ) LIMIT 39;
330 -- --------------------------------------------------------------------
331 -- Every Friday the 13th, forever:
333 -- DTSTART;TZID=US-Eastern:19970902T090000
334 -- EXDATE;TZID=US-Eastern:19970902T090000
335 -- RRULE:FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13
337 -- ==> (1998 9:00 AM EST)February 13;March 13;November 13
338 -- (1999 9:00 AM EDT)August 13
339 -- (2000 9:00 AM EDT)October 13
341 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13' ) LIMIT 35;
343 -- --------------------------------------------------------------------
344 -- The first Saturday that follows the first Sunday of the month,
347 -- DTSTART;TZID=US-Eastern:19970913T090000
348 -- RRULE:FREQ=MONTHLY;BYDAY=SA;BYMONTHDAY=7,8,9,10,11,12,13
350 -- ==> (1997 9:00 AM EDT)September 13;October 11
351 -- (1997 9:00 AM EST)November 8;December 13
352 -- (1998 9:00 AM EST)January 10;February 7;March 7
353 -- (1998 9:00 AM EDT)April 11;May 9;June 13...
355 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970913T090000', 'FREQ=MONTHLY;BYDAY=SA;BYMONTHDAY=7,8,9,10,11,12,13' ) LIMIT 10;
357 -- --------------------------------------------------------------------
358 -- Every four years, the first Tuesday after a Monday in November,
359 -- forever (U.S. Presidential Election day):
361 -- DTSTART;TZID=US-Eastern:19961105T090000
362 -- RRULE:FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU;BYMONTHDAY=2,3,4,
365 -- ==> (1996 9:00 AM EST)November 5
366 -- (2000 9:00 AM EST)November 7
367 -- (2004 9:00 AM EST)November 2
369 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19961105T090000', 'FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU;BYMONTHDAY=2,3,4,5,6,7,8' ) LIMIT 6;
371 -- --------------------------------------------------------------------
372 -- The 3rd instance into the month of one of Tuesday, Wednesday or
373 -- Thursday, for the next 3 months:
375 -- DTSTART;TZID=US-Eastern:19970904T090000
376 -- RRULE:FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3
378 -- ==> (1997 9:00 AM EDT)September 4;October 7
379 -- (1997 9:00 AM EST)November 6
380 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970904T090000', 'FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3' );
382 -- --------------------------------------------------------------------
383 -- The 2nd to last weekday of the month:
385 -- DTSTART;TZID=US-Eastern:19970929T090000
386 -- RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2
388 -- ==> (1997 9:00 AM EDT)September 29
389 -- (1997 9:00 AM EST)October 30;November 27;December 30
390 -- (1998 9:00 AM EST)January 29;February 26;March 30
392 --- SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970929T090000', 'FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2' ) LIMIT 8;
394 -- --------------------------------------------------------------------
395 -- Every 3 hours from 9:00 AM to 5:00 PM on a specific day:
397 -- DTSTART;TZID=US-Eastern:19970902T090000
398 -- RRULE:FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T170000Z
400 -- ==> (September 2, 1997 EDT)09:00,12:00,15:00
401 --- !! FREQ=HOURLY Not implemented
402 --- !! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T170000Z' );
404 -- --------------------------------------------------------------------
405 -- Every 15 minutes for 6 occurrences:
407 -- DTSTART;TZID=US-Eastern:19970902T090000
408 -- RRULE:FREQ=MINUTELY;INTERVAL=15;COUNT=6
410 -- ==> (September 2, 1997 EDT)09:00,09:15,09:30,09:45,10:00,10:15
411 --- !! FREQ=MINUTELY Not implemented
412 --- !! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('', '' );
414 -- --------------------------------------------------------------------
415 -- Every hour and a half for 4 occurrences:
417 -- DTSTART;TZID=US-Eastern:19970902T090000
418 -- RRULE:FREQ=MINUTELY;INTERVAL=90;COUNT=4
420 -- ==> (September 2, 1997 EDT)09:00,10:30;12:00;13:30
421 --- !! FREQ=HOURLY Not implemented
422 --- !! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('', '' );
424 -- --------------------------------------------------------------------
425 -- Every 20 minutes from 9:00 AM to 4:40 PM every day:
427 -- DTSTART;TZID=US-Eastern:19970902T090000
428 -- RRULE:FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40
430 -- RRULE:FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16
432 -- ==> (September 2, 1997 EDT)9:00,9:20,9:40,10:00,10:20,
433 -- ... 16:00,16:20,16:40
434 -- (September 3, 1997 EDT)9:00,9:20,9:40,10:00,10:20,
435 -- ...16:00,16:20,16:40
437 --- !! FREQ=MINUTELY and/or BYHOUR Not implemented
438 --- !! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970902T090000', 'FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40' ) LIMIT 500;
440 -- --------------------------------------------------------------------
441 -- An example where the days generated makes a difference because of
444 -- DTSTART;TZID=US-Eastern:19970805T090000
445 -- RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO
447 -- ==> (1997 EDT)Aug 5,10,19,24
449 -- changing only WKST from MO to SU, yields different results...
451 -- DTSTART;TZID=US-Eastern:19970805T090000
452 -- RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU
453 -- ==> (1997 EDT)August 5,17,19,31
455 --- !! WKST Not implemented. The second one works fine because WKST == SU in all our code.
456 --- !! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970805T090000', 'FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO' );
457 --- !! SET timezone TO 'US/Eastern'; SELECT * FROM event_instances('19970805T090000', 'FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU' );