From 2a662afaef0bed9f8cd153d60eee5ecbe85508ba Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 23 May 2024 06:50:25 -0700 Subject: [PATCH] Fixed: Time for episodes airing today being blank --- .../src/Utilities/Date/getRelativeDate.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/src/Utilities/Date/getRelativeDate.tsx b/frontend/src/Utilities/Date/getRelativeDate.tsx index cc0b76b72..3a7f4f143 100644 --- a/frontend/src/Utilities/Date/getRelativeDate.tsx +++ b/frontend/src/Utilities/Date/getRelativeDate.tsx @@ -30,22 +30,21 @@ function getRelativeDate({ return null; } - if (includeTime && !timeFormat) { + if ((includeTime || timeForToday) && !timeFormat) { throw new Error( - "getRelativeDate: 'timeFormat' is required when 'includeTime' is true" + "getRelativeDate: 'timeFormat' is required when 'includeTime' or 'timeForToday' is true" ); } const isTodayDate = isToday(date); - const time = - includeTime && timeFormat - ? formatTime(date, timeFormat, { - includeMinuteZero: true, - includeSeconds, - }) - : ''; + const time = timeFormat + ? formatTime(date, timeFormat, { + includeMinuteZero: true, + includeSeconds, + }) + : ''; - if (isTodayDate && timeForToday && timeFormat) { + if (isTodayDate && timeForToday) { return time; }