Module: Jekyll::Tasks::Dates
Overview
Dates module to configure jekyll’s bundle per website
Instance Method Summary collapse
- #days_in_year(date = Date.today) ⇒ Object
- #sundays_in_year(date = Date.today) ⇒ Object
- #working_days_in_year ⇒ Object
Instance Method Details
#days_in_year(date = Date.today) ⇒ Object
11 12 13 |
# File 'lib/jekyll/tasks/dates.rb', line 11 def days_in_year(date = Date.today) date.yday end |
#sundays_in_year(date = Date.today) ⇒ Object
15 16 17 |
# File 'lib/jekyll/tasks/dates.rb', line 15 def sundays_in_year(date = Date.today) (first_day_of_year(date)..date).to_a.count(&:sunday?) end |
#working_days_in_year ⇒ Object
19 20 21 |
# File 'lib/jekyll/tasks/dates.rb', line 19 def working_days_in_year days_in_year - sundays_in_year end |