Skip to content

Commit

Permalink
Fix timezone bug in getDate()
Browse files Browse the repository at this point in the history
Use of "PST" is problematic as it doesn't work during "PDT". Switched to the daylight savings time neutral "America/Los_Angeles" instead
  • Loading branch information
chantellosejo authored Jul 20, 2024
1 parent 3df072a commit 2d94e55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Neopets - Battledome Set Selector.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ function clone(data) {
}

function getDate() {
return new Date().toLocaleString("en-US", {timeZone: "PST"}).slice(0, 10).replace(",","")
return new Date().toLocaleString("en-US", {timeZone: "America/Los_Angeles"}).slice(0, 10).replace(",","")
}

function getItemURL(node, ability=false) {
Expand Down Expand Up @@ -1820,4 +1820,4 @@ function addFightCSS() {
border-radius: 50%;
}
`
}
}

0 comments on commit 2d94e55

Please sign in to comment.