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

DTEND should be non-inclusive #15

Open
radarfox opened this issue Apr 15, 2020 · 3 comments
Open

DTEND should be non-inclusive #15

radarfox opened this issue Apr 15, 2020 · 3 comments

Comments

@radarfox
Copy link

Hello,

I have discovered the bug in this library at the latest version 2.1. According to the RFC at 3.6.1:

The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event.

So for example, in this calendar:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:+//IDN ki-wi.cz//NONSGML Player Lighter//EN
BEGIN:VEVENT
UID:197857
DTSTAMP:20190920T025726Z
DTSTART:20200101T000000
DTEND:20201231T235900
SUMMARY:simple event
END:VEVENT
END:VCALENDAR

When you make a selection, that includes only the DTEND, it shouldn't contain any event or occurrences, but it does. DTEND + 1 works as expected and no event is returned.

const date = new Date('2020-12-31T23:59');
const match = expander.between(date, date);
return Boolean(match.events.length || match.occurrences.length);

This code will return true, but it should return false.

@mifi
Copy link
Owner

mifi commented Apr 24, 2020

I don't have time to look at this now, but if you provide a PR, I'm happy to consider merging

@radarfox
Copy link
Author

I understand. Luckily, this precision is not a must-have for the app I'm working on, but for someone it might be quite a problem, so I decided to at least report it.

bas080 added a commit to bas080/ical-expander that referenced this issue Jan 14, 2022
Gives the user more control as to what arrays are returned.

The benefit is that it allows filtering during iteration which is memory
friendly.

Possible related issue:

- mifi#15
@ray007
Copy link

ray007 commented Feb 24, 2023

IcalExpander.between() currently also has events in the result which end exactly at the beginning of the requested range.
This is probably a related problem.

My current workaround is to shrink the requested range by 1 millisecond from each end.

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

3 participants