Browse Source

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!!!
rails5
echarp 5 years ago
parent
commit
73dc008412
  1. 2
      lib/schedule.rb

2
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

Loading…
Cancel
Save