From da032e001e83d166a14ce30bfe00b049cf3e68ac Mon Sep 17 00:00:00 2001 From: xi <104683822+ximk@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:46:16 -0500 Subject: [PATCH] Add 18 hour closing time for registration (#2092) * Add more tournament closing times * Add 18 hour closing time for registration Closes #2091. * Remove extra space --- app/features/calendar/calendar-constants.ts | 1 + app/features/calendar/calendar-utils.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/app/features/calendar/calendar-constants.ts b/app/features/calendar/calendar-constants.ts index ac430c95e..dbcbdd894 100644 --- a/app/features/calendar/calendar-constants.ts +++ b/app/features/calendar/calendar-constants.ts @@ -93,6 +93,7 @@ export const REG_CLOSES_AT_OPTIONS = [ "3h", "6h", "12h", + "18h", "24h", "48h", "72h", diff --git a/app/features/calendar/calendar-utils.ts b/app/features/calendar/calendar-utils.ts index b76cd0232..88224c4ab 100644 --- a/app/features/calendar/calendar-utils.ts +++ b/app/features/calendar/calendar-utils.ts @@ -43,6 +43,8 @@ export function regClosesAtDate({ return new Date(startTime.getTime() - 360 * 60 * 1000); case "12h": return new Date(startTime.getTime() - 720 * 60 * 1000); + case "18h": + return new Date(startTime.getTime() - 1080 * 60 * 1000); case "24h": return new Date(startTime.getTime() - 1440 * 60 * 1000); case "48h": @@ -78,6 +80,8 @@ export function regClosesAtToDisplayName(closesAt: RegClosesAtOption) { return "6 hours"; case "12h": return "12 hours"; + case "18h": + return "18 hours"; case "24h": return "24 hours"; case "48h": @@ -108,6 +112,7 @@ export function datesToRegClosesAt({ if (diff === 180 * 60 * 1000) return "3h"; if (diff === 360 * 60 * 1000) return "6h"; if (diff === 720 * 60 * 1000) return "12h"; + if (diff === 1080 * 60 * 1000) return "18h"; if (diff === 1440 * 60 * 1000) return "24h"; if (diff === 2880 * 60 * 1000) return "48h"; if (diff === 4320 * 60 * 1000) return "72h";