Method: BankingCalendar::Calendar#banking_days_after

Defined in:
lib/banking_calendar/calendar.rb

#banking_days_after(date, interval) ⇒ Object

Given a date, add interval number of banking days.

If the given date is not a banking day, counting starts from the next banking day.

If banking hours are provided, returned date and time will be normalized to the end of banking day. If given date falls after banking hours, counting starts from the next banking day.



92
93
94
95
96
97
98
99
100
101
# File 'lib/banking_calendar/calendar.rb', line 92

def banking_days_after(date, interval)
  date = normalize_date(date, :after) if with_banking_hours?
  date = next_banking_day(date) unless banking_day?(date)

  interval.times do
    date = next_banking_day(date)
  end

  date
end