humanize icon indicating copy to clipboard operation
humanize copied to clipboard

Suggestion: add support to humanize ical rrule

Open ecornely opened this issue 1 year ago • 3 comments

Hello,

Thanks for that wonderful library.

In a project, I'll probably need to humanize some recurrence rules.

I don't know yet if I'll have to code it, but I thought it would definitely could be part of what this lib is able to do. I'm more a Java developer than python and I don't know how you could not introduce new dependencies to keep this lib lightweight or create an optional sub-module or whatever but I really think it could be a nice added feature.

ecornely avatar Sep 12 '24 07:09 ecornely

Thanks for the suggestion. My first impression is it might be out of scope, but please could you give some examples of input and expected output?

hugovk avatar Sep 12 '24 10:09 hugovk

Something like that: FREQ=DAILY => Repeats everyday FREQ=MONTHLY;BYMONTHDAY=1 => Repeats on the first day of every month FREQ=YEARLY;BYMONTH=3;BYMONTHDAY=17 => Repeats on March 17th of every year FREQ=WEEKLY;INTERVAL=2;BYDAY=SU,TH => Repeats every other week on Sundays and Thursdays FREQ=MONTHLY;BYDAY=3WE => Repeats on the third Wednesday of every month

Though I don't know if it has to always starts with Repeats or build the description in a different way. That might even be some options to generate in different "sentences"

And this if course in different languages.

ecornely avatar Sep 12 '24 10:09 ecornely

Here's a blog post on "The Deceptively Complex World of RRULEs in Calendar Events":

  • https://www.nylas.com/blog/calendar-events-rrules/

Which links to the spec in RFC 2445:

  • https://datatracker.ietf.org/doc/html/rfc2445#section-4.8.5.4

For comparison, here's a Go library to humanise RRULEs:

  • https://github.com/skillcoder/hrrule-go

hugovk avatar Sep 12 '24 14:09 hugovk