jkbrzt / rrule

JavaScript library for working with recurrence rules for calendar dates as defined in the iCalendar RFC and more.
https://jkbrzt.github.io/rrule
Other
3.3k stars 513 forks source link

Parse and transform cron expressions #51

Closed jgornick closed 6 years ago

jgornick commented 10 years ago

When you want to use rrule with another library that schedules jobs to run, they use cron expressions. It'd be nice to convert an rrule to a cron expression.

jkbrzt commented 10 years ago

Interesting idea. Ideally an existing implementation of a cron expressions parser would be used.

jkbrzt commented 10 years ago

https://github.com/harrisiirak/cron-parser

jpmckearin commented 9 years ago

Does anyone else have any ideas on how one might go about doing this? I looked at cron-parser as suggested by @jkbrzt but it simply parses cron string into "intervals" that you can iterate through. I don't see how that could be particularly useful in this feat. I'm having a hard time coming up with any solutions to the iCal -> cron conversion we're looking for.

cdaringe commented 7 years ago

@jpmckearin @jakubroztocil @jgornick, did you find anything? Where'd you land?

jpmckearin commented 7 years ago

Sorry @cdaringe I am afraid I can't be of much help. Soon after this we moved to using all cron to get around conversion issues.

cdaringe commented 7 years ago

thanks @jpmckearin. for others, i did find this. it looks pretty promising as something that takes RRules as input and does something on rule ticks. its not quite what this thread was all about, but close enough. Olivier's code wasn't merged, but it looks moderately robust and tested from a cursory view :)

jacktuck commented 7 years ago

I think the main blocker is that RRULE is much more granular than cron -- or at least i've found that to be the case, correct me if i'm wrong.

arolson101 commented 6 years ago

I think this issue is dead. Please update if more support is needed!