5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/extensions/date.rb', line 5
def school_day?
return false if SchoolDays.config.holiday_exceptions.include? self
return true if SchoolDays.config.included_day_exceptions.include? self
weekday = [1,2,3,4,5].include?(self.wday)
has_school = false
if weekday
has_school = true
has_school = SchoolDays.config.school_sessions.any? do |current_session|
current_session[:start_date] <= self && current_session[:end_date] >= self
end
end
has_school
end
|