module Jekyll::Tasks::Dates
Dates
module to configure jekyll's bundle per website
Public Instance Methods
days_in_year(date = Date.today)
click to toggle source
# File lib/jekyll/tasks/dates.rb, line 11 def days_in_year(date = Date.today) date.yday end
sundays_in_year(date = Date.today)
click to toggle source
# 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()
click to toggle source
# File lib/jekyll/tasks/dates.rb, line 19 def working_days_in_year days_in_year - sundays_in_year end
Private Instance Methods
first_day_of_year(date)
click to toggle source
# File lib/jekyll/tasks/dates.rb, line 25 def first_day_of_year(date) Date.new(date.year, 1, 1) end