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

@ -7,6 +7,8 @@ This file keeps track of changes in more human-readable fashion
* Filenames are now sanitized when writing files * Filenames are now sanitized when writing files
* "Tomorrow" in days list is now also displayed if Timezone is changed and grace period is off * "Tomorrow" in days list is now also displayed if Timezone is changed and grace period is off
* Frontend date display now uses configured timezone * Frontend date display now uses configured timezone
### v0.6.1
* Fixed date display when using `Local` timezone
## v0.5.0 ## v0.5.0
* Added a JS prompt to create new note * Added a JS prompt to create new note

View file

@ -1,6 +1,4 @@
{ {
"lang": "en",
"title.today": "Your day so far", "title.today": "Your day so far",
"title.days": "Previous days", "title.days": "Previous days",
"title.notes": "Notes", "title.notes": "Notes",

View file

@ -1,6 +1,4 @@
{ {
"lang": "ru",
"title.today": "Сегодняшний день", "title.today": "Сегодняшний день",
"title.days": "Предыдущие дни", "title.days": "Предыдущие дни",
"title.notes": "Заметки", "title.notes": "Заметки",

View file

@ -15,7 +15,7 @@ type AppInfo struct {
// Info contains app information // Info contains app information
var Info = AppInfo{ var Info = AppInfo{
Version: "0.6.0", Version: "0.6.1",
SourceLink: "https://git.a71.su/Andrew71/hibiscus", SourceLink: "https://git.a71.su/Andrew71/hibiscus",
} }

View file

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