From 73dc0084124ce6c07676b9729e9197b2f5984c5f Mon Sep 17 00:00:00 2001 From: echarp Date: Mon, 21 Nov 2016 16:00:40 +0100 Subject: [PATCH] Correction: the nth day was off by 1 when it was exactly a multiple of 7. For exemple monday the 28th was marked as the fifth monday of the month, wrong!!! --- lib/schedule.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/schedule.rb b/lib/schedule.rb index 3adda817..1dbd0962 100644 --- a/lib/schedule.rb +++ b/lib/schedule.rb @@ -11,7 +11,7 @@ module Schedule def prepare_schedule r = IceCube::Rule.send rule.split('_').first if rule == 'monthly_day' - r.day_of_week start_time.wday => [start_time.day / 7 + 1] + r.day_of_week start_time.wday => [(start_time.day - 1) / 7 + 1] else r end