Skip to content

Commit

Permalink
nullable time zone
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecM33 committed Sep 4, 2024
1 parent fafc530 commit 4249529
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/command-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions modules/interaction-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 4249529

Please sign in to comment.