Skip to content

Commit 4249529

Browse files
committed
nullable time zone
1 parent fafc530 commit 4249529

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

modules/command-util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ module.exports = {
621621
', ' + new Date((game.gameDate || game.datetime?.dateTime || game.gameData?.datetime?.dateTime)).toLocaleString('default', {
622622
month: 'short',
623623
day: 'numeric',
624-
timeZone: (process.env.TIME_ZONE.trim() || 'America/New_York'),
624+
timeZone: (process.env.TIME_ZONE?.trim() || 'America/New_York'),
625625
hour: 'numeric',
626626
minute: '2-digit',
627627
timeZoneName: 'short'
@@ -931,7 +931,7 @@ async function resolveDoubleHeaderSelection (interaction) {
931931
new ButtonBuilder()
932932
.setCustomId(game.gamePk.toString())
933933
.setLabel(new Date(game.gameDate).toLocaleString('en-US', {
934-
timeZone: (process.env.TIME_ZONE.trim() || 'America/New_York'),
934+
timeZone: (process.env.TIME_ZONE?.trim() || 'America/New_York'),
935935
hour: 'numeric',
936936
minute: '2-digit',
937937
timeZoneName: 'short'

modules/interaction-handlers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module.exports = {
8989
reply += date.date.substr(6) +
9090
(home ? ' vs. ' : ' @ ') + (home ? teams.away.team.name : teams.home.team.name) + ' ' +
9191
gameDate.toLocaleString('en-US', {
92-
timeZone: (process.env.TIME_ZONE.trim() || 'America/New_York'),
92+
timeZone: (process.env.TIME_ZONE?.trim() || 'America/New_York'),
9393
hour: 'numeric',
9494
minute: '2-digit',
9595
timeZoneName: 'short'
@@ -315,7 +315,7 @@ module.exports = {
315315
', ' + new Date(game.gameDate).toLocaleString('default', {
316316
month: 'short',
317317
day: 'numeric',
318-
timeZone: (process.env.TIME_ZONE.trim() || 'America/New_York'),
318+
timeZone: (process.env.TIME_ZONE?.trim() || 'America/New_York'),
319319
hour: 'numeric',
320320
minute: '2-digit',
321321
timeZoneName: 'short'

0 commit comments

Comments
 (0)