From 9fb126adbe88ed84634c9034dcbcf2576043e10e Mon Sep 17 00:00:00 2001 From: heymanishsharma Date: Mon, 8 Jul 2024 08:13:21 +0000 Subject: [PATCH] Remove RFC usage --- lib/business_time/config.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)