12

Ruby, Java, and Python all have several very good libraries which allow you to handle rfc2445's rrule very well.

I've done an extremely comprehensive search for a class/library which will handle the rrule and return dates of recurrence, however I haven't found 1 library in PHP will do it.

I am going to begin to write a PHP library which similar functionality to Ruby's ice_cube, however before I begin I just want to ensure I'm not reinventing the wheel.

So that brings me to this question, am I reinventing the wheel? Did I fail to find a library already written which handles date recurrence in PHP?

Auberon Vacher
  • 4,655
  • 1
  • 24
  • 36
tplaner
  • 8,363
  • 3
  • 31
  • 47

2 Answers2

21

After a thorough search I've determined that there is most likely not an open source date recurrence library written in PHP, so I have written my own.

I'm pleased to announce that I have released the initial version of a date recurrence library called When.

tplaner
  • 8,363
  • 3
  • 31
  • 47
  • 1
    Looks nice at first glance. Do you plan on supporting the ability to pass a raw RRULE string into the class with a start date? That would be ideal in cases where the UI passes that back from a recurrence control. No need for everyone to figure out the parsing step individually. – Brian Moeskau Oct 10 '10 at 21:00
  • Thanks for the suggestion, I have gone ahead and implemented the feature. If you have any further suggestions feel free to message me or add it as a issue on github. – tplaner Oct 11 '10 at 22:26
  • Awesome, thanks! I will check that out the update and provide feedback -- this came at the perfect time for a project I'm working on. Thanks! – Brian Moeskau Oct 11 '10 at 23:46
  • Wow, this looks excellent. I'm converting a Rails website to PHP, and the Rails site used an Occurrence gem. Glad to see you've provided a PHP library for this purpose. Kudos to you! – Jon L. Feb 26 '11 at 20:42
  • evolve, correct me if I am wrong, but this doesn't seem to be support excluded dates? Fantastic library though, it's been very useful – andrewtweber Feb 06 '13 at 04:04
  • @andrewtweber The current version does not, however the next version will include a method to exclude dates (such as holidays). – tplaner Feb 06 '13 at 15:56
  • @evolve: Thank you so much! I was actually writing my own class and stumbled on this! thank you so much! – Bharath Parlapalli Mar 12 '13 at 21:45
  • @evolve Hi! I've been playing around with three php recurrence libraries today, where none of them seems to do the trick. One of them is is yours which I'm very fond of, but it bothers me that I need to pass a RRULE or an options array to the constructor and the values are fixed. I have a rfc5545 string but I want to modify it later on. simshaun/recurr seems to do this part but it can't generate occurences. Also it would be nice to be possible to get next occurence on infinite rules. I'll open up issues on github when I get some time, hit me up if you want help. All in all, nice library! – Matej Svajger Mar 31 '16 at 21:43
  • When my start date is on 31 of the month , the following months that doesn't contain 31 are skipped . Is it configurable ? – Rova Ram May 31 '23 at 07:48
-1

Gud work but it seems that the INTERVAL PARAM does not works well with WEEKLY,MONTHLY,YEARLY frequencies,there are differences in result as compared to http://www.ietf.org/rfc/rfc2445.txt