This commit is contained in:
@@ -22,12 +22,18 @@ export default {
|
||||
// Get users default language code
|
||||
// first check if overriden in useroptions
|
||||
// if not then use browsers own setting
|
||||
//if not that then final default of en-US
|
||||
getResolvedLanguage() {
|
||||
let ov = window.$gz.store.state.userOptions.languageOverride;
|
||||
if (!window.$gz.util.stringIsNullOrEmpty(ov)) {
|
||||
return window.$gz.store.state.userOptions.languageOverride;
|
||||
let l = window.$gz.store.state.userOptions.languageOverride;
|
||||
if (!window.$gz.util.stringIsNullOrEmpty(l)) {
|
||||
return l;
|
||||
} else {
|
||||
return window.navigator.languages[0];
|
||||
l = window.navigator.languages[0];
|
||||
if (!window.$gz.util.stringIsNullOrEmpty(l)) {
|
||||
return l;
|
||||
} else {
|
||||
return "en-US";
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -35,14 +41,20 @@ export default {
|
||||
// Get users default time zone
|
||||
// first check if overriden in useroptions
|
||||
// if not then use browsers own setting
|
||||
// if that is empty then final default of "America/New_York"
|
||||
//https://www.iana.org/time-zones
|
||||
//https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
getResolvedTimeZoneName() {
|
||||
let ov = window.$gz.store.state.userOptions.timeZoneOverride;
|
||||
if (!window.$gz.util.stringIsNullOrEmpty(ov)) {
|
||||
return window.$gz.store.state.userOptions.timeZoneOverride;
|
||||
let tz = window.$gz.store.state.userOptions.timeZoneOverride;
|
||||
if (!window.$gz.util.stringIsNullOrEmpty(tz)) {
|
||||
return tz;
|
||||
} else {
|
||||
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
if (!window.$gz.util.stringIsNullOrEmpty(tz)) {
|
||||
return tz;
|
||||
} else {
|
||||
return "America/New_York";
|
||||
}
|
||||
}
|
||||
},
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user