From 119ae9c3c6a91b865bf7d679877f4deb78b35453 Mon Sep 17 00:00:00 2001 From: Andrew-71 Date: Fri, 10 May 2024 01:27:20 +0300 Subject: [PATCH] Fix bug with timezone display --- CHANGELOG.md | 2 ++ i18n/en.json | 2 -- i18n/ru.json | 2 -- info.go | 2 +- public/main.js | 9 +++++---- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33eb255..6a25246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ This file keeps track of changes in more human-readable fashion * Filenames are now sanitized when writing files * "Tomorrow" in days list is now also displayed if Timezone is changed and grace period is off * Frontend date display now uses configured timezone +### v0.6.1 +* Fixed date display when using `Local` timezone ## v0.5.0 * Added a JS prompt to create new note diff --git a/i18n/en.json b/i18n/en.json index 2bb68c4..9181009 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1,6 +1,4 @@ { - "lang": "en", - "title.today": "Your day so far", "title.days": "Previous days", "title.notes": "Notes", diff --git a/i18n/ru.json b/i18n/ru.json index 2806d34..0084368 100644 --- a/i18n/ru.json +++ b/i18n/ru.json @@ -1,6 +1,4 @@ { - "lang": "ru", - "title.today": "Сегодняшний день", "title.days": "Предыдущие дни", "title.notes": "Заметки", diff --git a/info.go b/info.go index 2d22989..30841c5 100644 --- a/info.go +++ b/info.go @@ -15,7 +15,7 @@ type AppInfo struct { // Info contains app information var Info = AppInfo{ - Version: "0.6.0", + Version: "0.6.1", SourceLink: "https://git.a71.su/Andrew71/hibiscus", } diff --git a/public/main.js b/public/main.js index 5089383..279b691 100644 --- a/public/main.js +++ b/public/main.js @@ -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) }