From 2f411094771d59192185a3b2551415947ba35115 Mon Sep 17 00:00:00 2001 From: Tony Bark Date: Wed, 12 Mar 2025 18:06:11 -0400 Subject: [PATCH] Renamed TimeSpanToAMPM - Renamed TimeSpanToAMPM() function to ConvertTo12Hour() - Removed extra new lines between GenerateSchedule() and ConvertTo12Hour() --- Program.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Program.cs b/Program.cs index a31d064..279ba50 100644 --- a/Program.cs +++ b/Program.cs @@ -34,14 +34,12 @@ List GenerateSchedule() return scheduledTimes; } - - /// /// Converts a TimeSpan into a 12-hour AM/PM formatted time string. /// /// The TimeSpan representing the time of day. /// A formatted string representing the time in AM/PM format. -string TimeSpanToAMPM(TimeSpan time) +string ConvertTo12Hour(TimeSpan time) { var minutes = time.TotalMinutes; var hours12 = time.Hours % 12; @@ -140,7 +138,7 @@ void PrintSchedule(bool isRestart = false) Console.WriteLine("=== Publish Times ==="); foreach (var time in scheduledTimes) { - var articleTime = $"Article {scheduledTimes.IndexOf(time) + 1} Scheduled at: {TimeSpanToAMPM(time)}"; + var articleTime = $"Article {scheduledTimes.IndexOf(time) + 1} Scheduled at: {ConvertTo12Hour(time)}"; // Correct format string to display time in 12-hour format with AM/PM Console.WriteLine(articleTime); // Store the schedule to memory for option export