Skip to content

Commit

Permalink
fix: eta time format detection from browser
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Stainbrook <[email protected]>
  • Loading branch information
rackrick committed Aug 17, 2023
1 parent da15789 commit ba4b595
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/store/gui/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,13 @@ export const getters: GetterTree<GuiState, any> = {
const setting = state.general.timeFormat
if (setting === '12hours') return true
if (setting === null) {
const browserLocale =
navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language
const timestring = new Date().toLocaleTimeString().split(' ');

if (browserLocale === 'en_us') return true
timestring.map(
p => {
if (['AM', 'PM'].includes(p)) return true;
}
)
}

return false
Expand Down

0 comments on commit ba4b595

Please sign in to comment.