jens-maus / node-ical

NodeJS class for parsing iCalendar/ICS files
Apache License 2.0
118 stars 50 forks source link

date-time type DTSTART without DTEND, but have DURATION #304

Closed eouia closed 6 months ago

eouia commented 7 months ago

Sorry for revamping the old topic. This is related to #90

For cases where a "VEVENT" calendar component specifies a "DTSTART" property with a DATE-TIME value type but no "DTEND" property, the event ends on the same calendar date and time of day specified by the "DTSTART" property.

I understand that only DTSTART without DTEND should be regarded as a momentary event. But how about with date-time type DTSTART and DURATION without DTEND?

In actual practice, Synology CalDAV provides that kind of VEVENTS, so node-ical cannot parse it correctly.

BEGIN:VCALENDAR
PRODID:-//Synology//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20240215T101655
LAST-MODIFIED:20240215T101655
DTSTAMP:20240215T101655
UID:20240215T101655-b6e4bbe9@192.168.178.100
SEQUENCE:2
SUMMARY:period test2
TRANSP:OPAQUE
DESCRIPTION:
LOCATION:Kriftel
X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-TITLE=Kriftel: geo:50.083558\,8.4693855
DTSTART:20240215T090000Z
DURATION:PT15M
END:VEVENT
END:VCALENDAR

If DURATION has meaning only on date type DTSTART, Why does the spec have H, M, and S options?

sdetweil commented 6 months ago

duration can support both date and date time

the spec says

Screenshot_20240216_103439_Chrome

DTEND does NOT say mandatory Screenshot_20240216_103841_Chrome

eouia commented 6 months ago

node-iCal seems that cannot handle this kind(DTSTART and DURATION but not DTEND) Can it?

sdetweil commented 6 months ago

I put in code 3 years ago for this when I fixed missing DTEND . and I think there was a testcase for that

https://github.com/jens-maus/node-ical/pull/96

edit: testcsse did not cover not DTEND/but duration

eouia commented 6 months ago

@sdetweil So... Is it a kind of thing to fix? Or Did I miss something to use?

sdetweil commented 6 months ago

I will try to test later today.

sdetweil commented 6 months ago

this handler is broken.
I will submit a PR and testcases for date-time and full date with and without duration

sdetweil commented 6 months ago

I submitted pr https://github.com/jens-maus/node-ical/pull/306