-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Description
First, thank you for your work on this library 🙏
When UNTIL
is defined simply as a date, like 20230331
, and you pass a UTC datetime to the second argument of the RRULE
constructor you get the following error:
new RRule('RRULE:FREQ=WEEKLY;WKST=SU;UNTIL=20230331;INTERVAL=2;BYDAY=TH', date_create());
Invalid UNTIL property: if the "DTSTART" property is specified as a date with UTC time or a date with local time and time zone reference, then the UNTIL rule part MUST be specified as a date with UTC time.
I understand if this technically abides by the RFC spec, however internally the library seems to cast the value of UNTIL
into a UTC datetime anyway.
> $rrule = (new RRule('RRULE:FREQ=WEEKLY;WKST=SU;UNTIL=20230331;INTERVAL=2;BYDAY=TH'))->getRule()
= [
"DTSTART" => null,
"FREQ" => "WEEKLY",
"UNTIL" => DateTime @1680220800 {#3854
date: 2023-03-31 00:00:00.0 UTC (+00:00),
},
"COUNT" => null,
"INTERVAL" => "2",
"BYSECOND" => null,
"BYMINUTE" => null,
"BYHOUR" => null,
"BYDAY" => "TH",
"BYMONTHDAY" => null,
"BYYEARDAY" => null,
"BYWEEKNO" => null,
"BYMONTH" => null,
"BYSETPOS" => null,
"WKST" => "SU",
]
Would it be acceptable for the library to be a little more forgiving in this case and allow a UTC datetime to be used as the value for DTSTART
?
Metadata
Metadata
Assignees
Labels
No labels