Module: Dates

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

Overview

Customers module to configure jekyll’s bundle per website

Instance Method Summary collapse

Instance Method Details

#days_in_year(date = Date.today) ⇒ Object



9
10
11
# File 'lib/jekyll_theme_marketing/dates.rb', line 9

def days_in_year(date = Date.today)
  date.yday
end

#sundays_in_year(date = Date.today) ⇒ Object



13
14
15
# File 'lib/jekyll_theme_marketing/dates.rb', line 13

def sundays_in_year(date = Date.today)
  (first_day_of_year(date)..date).to_a.count(&:sunday?)
end

#working_days_in_yearObject



17
18
19
# File 'lib/jekyll_theme_marketing/dates.rb', line 17

def working_days_in_year
  days_in_year - sundays_in_year
end