public function DateRepeatTestCase::todoTestTimeRrule in Date 7.2
Same name and namespace in other branches
- 7.3 date_repeat/tests/date_repeat.test \DateRepeatTestCase::todoTestTimeRrule()
Test RRULE by time.
@todo Enable pieces of this as the options are added to the API.
BYYEARDAY, BYSETPOS, BYWEEKNO, BYHOUR, BYMINUTE, HOURLY, MINUTELY, SECONDLY have not yet been implemented in date_repeat.
File
- date_repeat/
tests/ date_repeat.test, line 443 - Test Date Repeat calculations.
Class
- DateRepeatTestCase
- Test date repeat functions.
Code
public function todoTestTimeRrule() {
// @todo Add support for the BYYEARDAY keyword.
// Every 3rd year on the 1st, 100th and 200th day for 10 occurrences:
$date = "DTSTART;TZID=US-Eastern:19970101T090000";
$rule = "RRULE:FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200";
// ==> (1997 9:00 AM EST)January 1
// (1997 9:00 AM EDT)April 10;July 19
// (2000 9:00 AM EST)January 1
// (2000 9:00 AM EDT)April 9;July 18
// (2003 9:00 AM EST)January 1
// (2003 9:00 AM EDT)April 10;July 19
// (2006 9:00 AM EST)January 1
// @todo Add support for the BYWEEKNO keyword.
// Monday of week number 20 (where the default start of the week is Monday),
// forever:
$date = "DTSTART;TZID=US-Eastern:19970512T090000";
$rule = "RRULE:FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO";
// ==> (1997 9:00 AM EDT)May 12
// (1998 9:00 AM EDT)May 11
// (1999 9:00 AM EDT)May 17
// @todo Add support for the BYSETPOS keyword.
// The 3rd instance into the month of one of Tuesday, Wednesday or
// Thursday, for the next 3 months:
$date = "DTSTART;TZID=US-Eastern:19970904T090000";
$rule = "RRULE:FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3";
// ==> (1997 9:00 AM EDT)September 4;October 7
// (1997 9:00 AM EST)November 6
// The 2nd to last weekday of the month:
$date = "DTSTART;TZID=US-Eastern:19970929T090000";
$rule = "RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2";
// ==> (1997 9:00 AM EDT)September 29
// (1997 9:00 AM EST)October 30;November 27;December 30
// (1998 9:00 AM EST)January 29;February 26;March 30
// @todo Add support for the HOURLY keyword.
// Every 3 hours from 9:00 AM to 5:00 PM on a specific day:
$date = "DTSTART;TZID=US-Eastern:19970902T090000";
$rule = "RRULE:FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T170000Z";
// ==> (September 2, 1997 EDT)09:00,12:00,15:00
// @todo Add support for the MINUTELY keyword.
// Every 15 minutes for 6 occurrences:
$date = "DTSTART;TZID=US-Eastern:19970902T090000";
$rule = "RRULE:FREQ=MINUTELY;INTERVAL=15;COUNT=6";
// ==> (September 2, 1997 EDT)09:00,09:15,09:30,09:45,10:00,10:15
// @todo Add support for the MINUTELY keyword.
// Every hour and a half for 4 occurrences:
$date = "DTSTART;TZID=US-Eastern:19970902T090000";
$rule = "RRULE:FREQ=MINUTELY;INTERVAL=90;COUNT=4";
// ==> (September 2, 1997 EDT)09:00,10:30;12:00;13:30
// @todo Add support for the BYHOUR keyword.
// Every 20 minutes from 9:00 AM to 4:40 PM every day:
$date = "DTSTART;TZID=US-Eastern:19970902T090000";
$rule = "RRULE:FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16";
// @todo Add support for the BYHOUR keyword.
// @todo Add support for the BYMINUTE keyword.
$rule = "RRULE:FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40";
// or.
// @todo Add support for the BYHOUR keyword.
// @todo Add support for the MINUTELY keyword.
$rule = "RRULE:FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16";
// ==> (September 2, 1997 EDT)9:00,9:20,9:40,10:00,10:20,16:00,16:20,16:40
// (September 3, 1997 EDT)9:00,9:20,9:40,10:00,10:20,16:00,16:20,16:40
// @todo Add support for the SECONDLY keyword.
// @todo Add a test to check the SECONDLY keyword.
}