diff --git a/modules/command-util.js b/modules/command-util.js index a02aa4f..d1d4268 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: (process.env.TIME_ZONE.trim() || '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: (process.env.TIME_ZONE.trim() || '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 7d23259..6f0917e 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: (process.env.TIME_ZONE.trim() || '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: (process.env.TIME_ZONE.trim() || 'America/New_York'), + timeZone: (process.env.TIME_ZONE?.trim() || 'America/New_York'), hour: 'numeric', minute: '2-digit', timeZoneName: 'short'