mardi 30 août 2016

Anyone here used Recurrence Gem?

I just found out about this gem a couple of weeks ago that exactly serves my purpose (http://ift.tt/13sogAK). Seems to work fine until I started implementing the :except feature doesn't seem to be working as intended. I did write the issue to the gem owner but seems to be inactive at the moment.

I was hoping someone has used this and fond some work around or have any suggestions. Please check the scenario below.

Scenario

r = Recurrence.new( {:interval=>3, :starts=>Wed, 31 Aug 2016, :until=>Mon, 31 Oct 2016, :except=>[Sat, 03 Sep 2016, Sun, 04 Sep 2016, Sat, 10 Sep 2016, Sun, 11 Sep 2016, Sat, 17 Sep 2016, Sun, 18 Sep 2016, Sat, 24 Sep 2016, Sun, 25 Sep 2016, Sat, 01 Oct 2016, Sun, 02 Oct 2016, Sat, 08 Oct 2016, Sun, 09 Oct 2016, Sat, 15 Oct 2016, Sun, 16 Oct 2016, Sat, 22 Oct 2016, Sun, 23 Oct 2016, Sat, 29 Oct 2016, Sun, 30 Oct 2016]})

Note: The :except dates are basically excluding all saturday and sunday.

Interval: 3 days (item should appear every 3rd day) Expected Dates: Aug 31, Sept 5, Sept 8, Sept 13

Results: Aug 31, Sept 6, Sept 9, Sept 12

If you can see, it got messed up during Sept 5 instead appearing on Sept 6.

Aug 31 is wednesday so on the 3rd day excluding sat sun should have been Sept 5.

Aucun commentaire:

Enregistrer un commentaire