1 # frozen_string_literal: true
10 def date_for(date_hash)
11 "#{date_hash[:year]}#{date_hash[:month].to_s.rjust(2, "0")}#{date_hash[:day].to_s.rjust(2, "0")}"
14 def hyphenated_date_for(date_hash)
15 "#{date_hash[:year]}-#{date_hash[:month].to_s.rjust(2, "0")}-#{date_hash[:day].to_s.rjust(2, "0")}"
19 # Beware: This assumes your system is in America/Toronto time.
28 def weekday_for(date_hash)
29 Date.new(date_hash[:year], date_hash[:month], date_hash[:day]).wday