From 53939633d070ff498fbb9ae2f26a0be0317efee6 Mon Sep 17 00:00:00 2001 From: Brendan F Date: Sun, 25 Jun 2023 22:22:37 -0700 Subject: Move startDate to one defined spot --- src/helpers/scoreToEmoji.ts | 2 +- src/helpers/todaysSolution.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/scoreToEmoji.ts b/src/helpers/scoreToEmoji.ts index ffc2fe2..fd55627 100644 --- a/src/helpers/scoreToEmoji.ts +++ b/src/helpers/scoreToEmoji.ts @@ -1,8 +1,8 @@ import { GuessType } from "../types/guess"; +import { startDate } from "../constants"; export function scoreToEmoji(guesses: GuessType[]): string { const msInDay = 86400000; - const startDate = new Date('5/5/2023'); const todaysDate = new Date(); const index = Math.floor((todaysDate.getTime() - startDate.getTime() )/msInDay) + 1 const emojis = { diff --git a/src/helpers/todaysSolution.ts b/src/helpers/todaysSolution.ts index 50e75ce..32760cb 100644 --- a/src/helpers/todaysSolution.ts +++ b/src/helpers/todaysSolution.ts @@ -1,11 +1,10 @@ -import { songs } from "../constants"; +import { songs, startDate } from "../constants"; // const epochMs = new Date(2022, 3, 10).valueOf(); // const now = Date.now(); // const index = Math.floor((now - epochMs) / msInDay); const msInDay = 86400000; -const startDate = new Date('4/15/2022'); const todaysDate = new Date(); const index = Math.floor((todaysDate.getTime() - startDate.getTime() )/msInDay) -- cgit v1.2.3