From da15dae17cd040451a9b8a6cff409e84e9f672b1 Mon Sep 17 00:00:00 2001 From: Alec Date: Mon, 2 Sep 2024 19:27:59 -0400 Subject: [PATCH] trim arg, fix start command --- modules/command-util.js | 4 ++-- modules/interaction-handlers.js | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/command-util.js b/modules/command-util.js index 05a84b2..a02aa4f 100644 --- a/modules/command-util.js +++ b/modules/command-util.js @@ -621,7 +621,7 @@ module.exports = { ', ' + new Date((game.gameDate || game.datetime?.dateTime || game.gameData?.datetime?.dateTime)).toLocaleString('default', { month: 'short', day: 'numeric', - timeZone: 'America/New_York', + timeZone: (process.env.TIME_ZONE.trim() || 'America/New_York'), hour: 'numeric', minute: '2-digit', timeZoneName: 'short' @@ -931,7 +931,7 @@ async function resolveDoubleHeaderSelection (interaction) { new ButtonBuilder() .setCustomId(game.gamePk.toString()) .setLabel(new Date(game.gameDate).toLocaleString('en-US', { - timeZone: 'America/New_York', + timeZone: (process.env.TIME_ZONE.trim() || 'America/New_York'), hour: 'numeric', minute: '2-digit', timeZoneName: 'short' diff --git a/modules/interaction-handlers.js b/modules/interaction-handlers.js index d547606..7d23259 100644 --- a/modules/interaction-handlers.js +++ b/modules/interaction-handlers.js @@ -89,7 +89,7 @@ module.exports = { reply += date.date.substr(6) + (home ? ' vs. ' : ' @ ') + (home ? teams.away.team.name : teams.home.team.name) + ' ' + gameDate.toLocaleString('en-US', { - timeZone: 'America/New_York', + timeZone: (process.env.TIME_ZONE.trim() || 'America/New_York'), hour: 'numeric', minute: '2-digit', timeZoneName: 'short' @@ -315,7 +315,7 @@ module.exports = { ', ' + new Date(game.gameDate).toLocaleString('default', { month: 'short', day: 'numeric', - timeZone: 'America/New_York', + timeZone: (process.env.TIME_ZONE.trim() || 'America/New_York'), hour: 'numeric', minute: '2-digit', timeZoneName: 'short' diff --git a/package.json b/package.json index 83d3f38..111ba19 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "main.js", "scripts": { "test": "jasmine", - "start": "NODE_ENV=production && node main.js", + "start": "NODE_ENV=production && node deploy-commands.js && node main.js", "heroku-postbuild": "mkdir ./.cache && mv /app/.cache/puppeteer ./.cache" }, "author": "",