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:
219
179
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.
In this example I had a weekly repeating event on Tuesday at 6pm EDT (-04:00 = 22:00 UTC).
Summary
Who does this help?
This satisfies my own needs, and the needs of those expressed in:
219
179
Both contain discussions on how to "hack" a solution: appending
EXDATE:
to any other string input that doesn't get sanitized byfoldLine()
.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 ofDateArray[]
, 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
andexcludeDateOutputType
.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.
In this example I had a weekly repeating event on Tuesday at 6pm EDT (-04:00 = 22:00 UTC).
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!