class Date
Constants
- WDAYS
- WEEKEND_ABBR_DAYNAMES
- WEEKEND_DAYNAMES
- WEEKEND_WDAYS
- WORKWEEK_ABBR_DAYNAMES
- WORKWEEK_DAYNAMES
- WORKWEEK_WDAYS
Public Instance Methods
weekend?()
click to toggle source
@return [Boolean] true if the date is a weekend day: Sat, Sun
@example
d = Date.parse('2008-01-05') d.wday => 6 d.weekend? => true
# File lib/sixarm_ruby_date_days.rb, line 38 def weekend? WEEKEND_WDAYS.include? wday end
workweek?()
click to toggle source
@return [Boolean] true if the date is a workweek day: Mon, Tue, Wed, Thu, Fri
@example
d = Date.parse('2008-01-01') d.wday => 2 d.weekday? => true
# File lib/sixarm_ruby_date_days.rb, line 26 def workweek? WORKWEEK_WDAYS.include? wday end