Fix bug with timezone display

This commit is contained in:
Andrew-71 2024-05-10 01:27:20 +03:00
parent fa2ecacce5
commit 119ae9c3c6
5 changed files with 8 additions and 9 deletions

View file

@ -1,11 +1,12 @@
// Format time in "Jan 02, 2006" format
function formatDate(date) {
let dateFormat = new Intl.DateTimeFormat([langName, "en"], {
let options = {
year: 'numeric',
month: 'short',
day: 'numeric',
timeZone: timeZone
})
day: 'numeric'
}
if (timeZone !== "Local") { options.timeZone = timeZone }
let dateFormat = new Intl.DateTimeFormat([langName, "en"], options)
return dateFormat.format(date)
}