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!!!
This commit is contained in:
echarp 2016-11-21 16:00:40 +01:00
parent 8290c6a88c
commit 73dc008412
1 changed files with 1 additions and 1 deletions

View File

@ -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