From 7e49b96f9216db134204086311ebb25dff620cb4 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 31 Oct 2023 16:08:14 -0400 Subject: [PATCH] Centralize constants --- src/services/utilities.ts | 10 ++++++++++ src/views/ScheduleView.vue | 23 +---------------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 35ef5e6..bfdb2ad 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1,3 +1,7 @@ +import dayjs from 'dayjs' +import customParseFormat from 'dayjs/plugin/customParseFormat' +dayjs.extend(customParseFormat) + export const SITE_URL = 'https://sba.manticorum.com' export const CURRENT_SEASON = 8 @@ -8,6 +12,12 @@ export const GAMES_PER_SEASON = 72 export const WEEKS_PER_SEASON = 18 +// TODO: Annually update this start date and holidays with two week series or get it from the DB +export const SEASON_START_DATE: dayjs.Dayjs = dayjs('07-31-2023', 'MM/DD/YYYY') +export const THANKSGIVING: dayjs.Dayjs = dayjs('11-23-2023', 'MM/DD/YYYY') +export const CHRISTMAS: dayjs.Dayjs = dayjs('12-25-2023', 'MM/DD/YYYY') + + export const POS_MAP = { 'P': 1, 'C': 2, diff --git a/src/views/ScheduleView.vue b/src/views/ScheduleView.vue index b60c0d6..6915b1d 100644 --- a/src/views/ScheduleView.vue +++ b/src/views/ScheduleView.vue @@ -105,7 +105,7 @@