Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecurrencePattern.Until DateTime property should be a CalDateTime #588

Open
rmtexas opened this issue Jul 2, 2024 · 5 comments
Open

RecurrencePattern.Until DateTime property should be a CalDateTime #588

rmtexas opened this issue Jul 2, 2024 · 5 comments

Comments

@rmtexas
Copy link

rmtexas commented Jul 2, 2024

iCalendar spec says that the UNTIL format should match the same format as DTSTART. And if DTSTART specifies a TZID then the UNTIL should as well.
Because UNTIL is just a DateTime, there is no way to specify the timezone that should be applied the property.
So serialization of a recurrence comes out incorrectly.
Example:
BEGIN:VEVENT
DTEND;TZID=Central Standard Time:20190208T133000
DTSTAMP:20240702T173339Z
DTSTART;TZID=Central Standard Time:20190208T130000
RRULE:FREQ=DAILY;UNTIL=20190215T130000;WKST=SU
SEQUENCE:0
SUMMARY:Intro 1 : Recurring Appointment
UID:1
END:VEVENT

Notice that UNTIL has no TZID identifier applied. This is against spec.

@RemcoBlok
Copy link

Similarly the EXDATE also does not serialize a TZID. See #614

@RemcoBlok
Copy link

RemcoBlok commented Oct 18, 2024

The way I read the standard, UNTIL must have the same value type as DTSTART. If DTSTART is a DATE, then UNTIL must be a DATE. If DTSTART is a DATE-TIME, then UNTIL must be a DATE-TIME. Oddly, when DTSTART specifies a TZID, UNTIL must be in UTC, and not in the TZID of DTSTART. See https://icalendar.org/iCalendar-RFC-5545/3-3-10-recurrence-rule.html.

"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"

It does not say the same thing about EXDATE having to be in UTC by the way, which is nice and consistent. See https://icalendar.org/iCalendar-RFC-5545/3-8-5-1-exception-date-times.html. For EXDATE you must be able to specify a TZID.

@minichma
Copy link
Collaborator

I agree that Until should not be specified as DateTime, as it is rather ambiguous (see #638). However, I fully agree with @RemcoBlok that according to the RFC, UNTIL MUST be specified either in UTC or as floating time (without TZ).

@axunonb
Copy link
Collaborator

axunonb commented Nov 19, 2024

Agree - now what does it mean in code? Only use UTC without implementing a floating time representation?
For CalDateTime in #638 a date/time with TZ null finally resolves to system's local time. Should TZ null be a floating time rather?

public DateTime Until
{
get => _until;
set
{
if (_until == value && _until.Kind == value.Kind)
{
return;
}
_until = value;
}
}

@minichma
Copy link
Collaborator

Should TZ null be a floating time rather?

Yes, I think this would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants