Guest User

Untitled

a guest
May 26th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1.  
  2.  
  3. @instructions.reject do |instruction|
  4. unless instruction.frequency == 'weekly'
  5. p_date = Runt::PDate.day(instruction.start_day.year, instruction.start_day.month, instruction.start_day.mday)
  6. case instruction.frequency
  7. when "bi_monthly"
  8. r = Runt::EveryTE.new(p_date, 14, Runt::DPrecision::DAY)
  9. when "monthly"
  10. r = Runt::EveryTE.new(p_date, 28, Runt::DPrecision::DAY)
  11. end
  12. if !r.include?(date)
  13. true
  14. else
  15. false
  16. end
  17. end
  18. true
  19. end
Add Comment
Please, Sign In to add comment