Class: Date

Inherits:
Object
  • Object
show all
Includes:
BusinessTime::TimeExtensions
Defined in:
lib/business_time/core_ext/date.rb

Overview

Add workday and weekday concepts to the Date class

Instance Method Summary collapse

Methods included from BusinessTime::TimeExtensions

#business_time_until, #during_business_hours?, #weekday?, #workday?

Instance Method Details

#business_dates_until(to_date) ⇒ Object



9
10
11
# File 'lib/business_time/core_ext/date.rb', line 9

def business_dates_until(to_date)
  (self...to_date).select { |day| day.workday? }
end

#business_days_until(to_date) ⇒ Object



5
6
7
# File 'lib/business_time/core_ext/date.rb', line 5

def business_days_until(to_date)
  business_dates_until(to_date).size
end