diff --git a/src/store/gui/getters.ts b/src/store/gui/getters.ts index c0142e8e1..bdd6c980a 100644 --- a/src/store/gui/getters.ts +++ b/src/store/gui/getters.ts @@ -157,9 +157,7 @@ export const getters: GetterTree = { const setting = state.general.timeFormat if (setting === '12hours') return true if (setting === null) { - // create a time string, cut the last 2 chars and check if it contains AM or PM - const timeString = new Date().toLocaleString(navigator.language, { timeStyle: 'short' }).slice(-2) - if (['AM', 'PM'].includes(timeString)) return true + return Intl.DateTimeFormat(navigator.language, { hour: 'numeric' }).resolvedOptions().hour12 } return false