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

EXDATE support (string) #246

Merged
merged 3 commits into from
Sep 14, 2023
Merged

Conversation

TiE23
Copy link
Contributor

@TiE23 TiE23 commented Jul 13, 2023

Summary

simple inclusion of EXDATE support in formatEvent() supporting a simple string

Includes a unit test and a detailed entry in the README

Who does this help?

This satisfies my own needs, and the needs of those expressed in:

Both contain discussions on how to "hack" a solution: appending EXDATE: to any other string input that doesn't get sanitized by foldLine().

That definitely works. But I thought this was kinda silly. It wouldn't take much to support EXDATE, right?

Attempt using DateArray[]

I spent a little time flirting with the idea of defining excludeDate as an array of DateArray[], but I realized that it would "imply" the allowance of a mix DATE and DATE-TIME input.

Then I started thinking about how I might have it be [number, number, number][] | [number, number, number, number][] | [number, number, number, number, number][]. But that seemed ugly.

And then we'd have to provide more attributes like excludeDateInputType and excludeDateOutputType.

Keep it simple with a string input

I realized that it was far simpler to let the end user to provide the string themself, like is already expected with recurrenceRule.

Note on README Doc example

In testing, using MacOS's Calendar App, I found that support for EXDATE;VALUE=DATE:YYYYMMDD doesn't work. So, as a result of this test revealing that iCal support is spotty, I removed any mention of it in the README.

Testing

I tested EXDATE with MacOS's Calendar App with a recurrence rule calendar.
Screenshot 2023-07-13 at 3 34 41 PM
In this example I had a weekly repeating event on Tuesday at 6pm EDT (-04:00 = 22:00 UTC).

DTSTART:20221101T220000Z
EXDATE:20230711T220000Z,20230718T220000Z

As you can see, the recurring events on July 11 and July 18 are excluded.

(This was really just to make sure that my README examples are correct).

Thanks!

I hope this addition is a decent contribution. I'm proud to say it's not my first to this lovely project (#220)

Please let me know if revisions to the README or anything else is desired. Cheers!

TiE23 and others added 3 commits July 13, 2023 15:27
…le string

Includes a unit test and a detailed entry in the README
…derstand `EXDATE;VALUE=DATE:YYYYMMDD` input

So much for standards...

So, with that backfiring, I'm reducing the example documentation to only mention the default support for `DATE-TIME`
@adamgibbons adamgibbons merged commit 03d11da into adamgibbons:master Sep 14, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants