From e49ffc062d829d4d74b025217bd36b048428deef Mon Sep 17 00:00:00 2001 From: Student Date: Thu, 26 May 2022 12:02:07 -0700 Subject: [PATCH] capitilize 'am' and 'pm' in time format --- app/services/api/hours_xml_to_json_parser.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/api/hours_xml_to_json_parser.rb b/app/services/api/hours_xml_to_json_parser.rb index ee828b5..f8c2d89 100644 --- a/app/services/api/hours_xml_to_json_parser.rb +++ b/app/services/api/hours_xml_to_json_parser.rb @@ -77,12 +77,12 @@ def self.hours_available?(hours) def self.get_formatted_open_time(day) open_time = parse_open_time(day) - open_time.present? ? Time.parse(open_time).strftime("%l:%M%P") : "" + open_time.present? ? Time.parse(open_time).strftime("%l:%M %p") : "" end def self.get_formatted_close_time(day) close_time = parse_close_time(day) - close_time.present? ? Time.parse(close_time).strftime("%l:%M%P") : "" + close_time.present? ? Time.parse(close_time).strftime("%l:%M %p") : "" end def self.get_formatted_date(day) @@ -121,7 +121,7 @@ def self.closes_at_night?(day) def self.formatted_hours(open_time, close_time) if (close_time == "00:14") - "#{Time.parse(open_time).strftime("%l:%M%P")} - Midnight" + "#{Time.parse(open_time).strftime("%l:%M %p")} - Midnight" elsif (open_time == "00:14") "Closes at #{close_time}" elsif (open_time == "00:00" && close_time == "23:59") @@ -129,7 +129,7 @@ def self.formatted_hours(open_time, close_time) elsif (open_time.eql? close_time) "Closed" else - "#{Time.parse(open_time).strftime("%l:%M%P")} -#{Time.parse(close_time).strftime("%l:%M%P")}" + "#{Time.parse(open_time).strftime("%l:%M %p")} -#{Time.parse(close_time).strftime("%l:%M %p")}" end end