Module: Jekyll::Tasks::Dates

Extended by:
Dates
Included in:
Dates
Defined in:
lib/jekyll/tasks/dates.rb

Overview

Dates module to configure jekyll’s bundle per website

Instance Method Summary collapse

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_yearObject



19
20
21
# File 'lib/jekyll/tasks/dates.rb', line 19

def working_days_in_year
  days_in_year - sundays_in_year
end