diff --git a/lib/business_time/config.rb b/lib/business_time/config.rb index 6a3fece..8ab439f 100644 --- a/lib/business_time/config.rb +++ b/lib/business_time/config.rb @@ -30,6 +30,10 @@ class << self attr_accessor :holidays end + + DAY_NAMES = [ + 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' + ] def self.work_week=(days) @work_week = days @@ -39,7 +43,7 @@ def self.work_week=(days) def self.weekdays return @weekdays unless @weekdays.nil? - lowercase_day_names = ::Time::RFC2822_DAY_NAME.map(&:downcase) + lowercase_day_names = DAY_NAMES.map(&:downcase) @weekdays = work_week.each_with_object([]) do |day_name, days| day_num = lowercase_day_names.find_index(day_name.to_s.downcase)