Skip to content

Fix: clock shows wrong timezone after header reload (#1640) - #1735

Merged
jokob-sk merged 1 commit into
netalertx:mainfrom
Valiante:patch-2
Aug 13, 2026
Merged

Fix: clock shows wrong timezone after header reload (#1640)#1735
jokob-sk merged 1 commit into
netalertx:mainfrom
Valiante:patch-2

Conversation

@Valiante

@Valiante Valiante commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

tz/LOCALE were evaluated once as module-level consts at script-load time. clearCache() (the header reload button) wipes localStorage right before reloading, so that reload could read an empty settings cache, fall back to the hardcoded 'Europe/Berlin' default, and stay locked to that wrong value for the rest of the page's life. Moved the reads inside localizeTimestamp() so they're evaluated fresh on every call instead. Fixes #1640

Summary by CodeRabbit

  • Bug Fixes
    • Timestamps now consistently reflect the latest timezone and locale settings whenever they are displayed.
    • Existing fallback behavior remains unchanged.

tz/LOCALE were evaluated once as module-level consts at script-load time. clearCache() (the header reload button) wipes localStorage right before reloading, so that reload could read an empty settings cache, fall back to the hardcoded 'Europe/Berlin' default, and stay locked to that wrong value for the rest of the page's life. Moved the reads inside localizeTimestamp() so they're evaluated fresh on every call instead.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cc1e4ae6-16c2-42f7-aaf2-027e7f01ce5b

📥 Commits

Reviewing files that changed from the base of the PR and between 21aeaf2 and 229755b.

📒 Files selected for processing (1)
  • front/js/common.js

📝 Walkthrough

Walkthrough

localizeTimestamp now retrieves timezone and locale settings on every invocation. Existing fallback behavior remains unchanged.

Changes

Localization refresh

Layer / File(s) Summary
Timestamp localization settings
front/js/common.js
localizeTimestamp calls getSetting() for TIMEZONE and UI_LOCALE during each invocation. Existing fallbacks remain unchanged.

Suggested reviewers: jokob-sk

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main fix: incorrect timezone display after a header reload.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jokob-sk

Copy link
Copy Markdown
Collaborator

Thank you for the fix @Valiante 🙏

@jokob-sk
jokob-sk merged commit eed8a39 into netalertx:main Aug 13, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI reload, unauthorized API calls, clock jump, and DIG plugin flashing after saving settings

2 participants