diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 81a80c34..fdab67eb 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -45,10 +45,9 @@ CURRENT TODOs @@@@@@@@@@@ ROADMAP STAGE 1 and 2: -todo: add set loginpassword option to menu in usersettings form todo: modify locale object to use overrides for language, timezone -todo: User settings documentation +todo: User settings && password change documentation - do it now? - needs section explaining about how locale is displayed so can link to it from other places - is that it's own page? (maybe because each subject should be short and focused and look clean with lots of whitespace, clear large text) diff --git a/ayanova/src/api/initialize.js b/ayanova/src/api/initialize.js index da15be7a..b0dd737f 100644 --- a/ayanova/src/api/initialize.js +++ b/ayanova/src/api/initialize.js @@ -745,6 +745,34 @@ export default function initialize() { ); window.$gz.eventBus.$emit("notify-error", msg); } else { + //Check if overrides and use them here + //or else use browser defaults + //locale().getBrowserFirstLanguage() + //locale().getBrowserTimeZoneName() + + +/* +concurrencyToken: 7478681 +​​ +currencyName: "USD" +​​ +emailAddress: null +​​ +hour12: true +​​ +id: 1 +​​ +languageOverride: null +​​ +timeZoneOverride: null +​​ +uiColor: "#000000" +​​ +userId: 1 +*/ + + + window.$gz.store.commit("setLocale", { languageOverride: "en-US", timeZoneOverride: "America/New_York", diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index ebae92ed..1ed4d6b8 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -199,7 +199,7 @@ export default { // Get users default time zone //https://www.iana.org/time-zones //https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - getTimeZoneName() { + getBrowserTimeZoneName() { return Intl.DateTimeFormat().resolvedOptions().timeZone; }, ////////////////////////////////////////////////// @@ -229,7 +229,7 @@ export default { return ""; } if (!timeZoneName) { - timeZoneName = this.getTimeZoneName(); + timeZoneName = this.getBrowserTimeZoneName(); } if (!languageName) { languageName = this.getBrowserLanguages(); @@ -262,7 +262,7 @@ export default { return ""; } if (!timeZoneName) { - timeZoneName = this.getTimeZoneName(); + timeZoneName = this.getBrowserTimeZoneName(); } if (!languageName) { languageName = this.getBrowserLanguages(); @@ -289,7 +289,7 @@ export default { return ""; } if (!timeZoneName) { - timeZoneName = this.getTimeZoneName(); + timeZoneName = this.getBrowserTimeZoneName(); } if (!languageName) { languageName = this.getBrowserLanguages(); @@ -327,7 +327,7 @@ export default { //also fr-CA does as well as possibly en-CA //https://stackoverflow.com/a/58633686/8939 if (!timeZoneName) { - timeZoneName = this.getTimeZoneName(); + timeZoneName = this.getBrowserTimeZoneName(); } return new Date(value).toLocaleTimeString("sv-SE", { timeZone: timeZoneName @@ -342,7 +342,7 @@ export default { localTimeDateStringToUTC8601String(value, timeZoneName) { //https://moment.github.io/luxon/docs/manual/zones.html#creating-datetimes-in-a-zone if (!timeZoneName) { - timeZoneName = this.getTimeZoneName(); + timeZoneName = this.getBrowserTimeZoneName(); } //parse in the time in the currently used timezone return window.$gz.DateTime.fromISO(value, { @@ -365,7 +365,7 @@ export default { //also fr-CA does as well as possibly en-CA //https://stackoverflow.com/a/58633686/8939 if (!timeZoneName) { - timeZoneName = this.getTimeZoneName(); + timeZoneName = this.getBrowserTimeZoneName(); } return new Date(value).toLocaleDateString("sv-SE", { timeZone: timeZoneName diff --git a/ayanova/src/components/date-control.vue b/ayanova/src/components/date-control.vue index 5572aa36..89eeb4ec 100644 --- a/ayanova/src/components/date-control.vue +++ b/ayanova/src/components/date-control.vue @@ -45,7 +45,7 @@ export default { oldDate: null, dlgdate: false, //cache display format stuff - timeZoneName: window.$gz.locale.getTimeZoneName(), + timeZoneName: window.$gz.locale.getBrowserTimeZoneName(), languageName: window.$gz.locale.getBrowserLanguages(), defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0] }), diff --git a/ayanova/src/components/date-time-control.vue b/ayanova/src/components/date-time-control.vue index b0cd88c4..43849997 100644 --- a/ayanova/src/components/date-time-control.vue +++ b/ayanova/src/components/date-time-control.vue @@ -85,7 +85,7 @@ export default { dlgdate: false, dlgtime: false, //cache display format stuff - timeZoneName: window.$gz.locale.getTimeZoneName(), + timeZoneName: window.$gz.locale.getBrowserTimeZoneName(), languageName: window.$gz.locale.getBrowserLanguages(), hour12: window.$gz.locale.getHour12(), defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0] diff --git a/ayanova/src/components/gz-data-table.vue b/ayanova/src/components/gz-data-table.vue index 39f95d14..7cd945d2 100644 --- a/ayanova/src/components/gz-data-table.vue +++ b/ayanova/src/components/gz-data-table.vue @@ -602,7 +602,7 @@ function buildRecords(listData, columndefinitions) { } //cache display format stuff - var timeZoneName = window.$gz.locale.getTimeZoneName(); + var timeZoneName = window.$gz.locale.getBrowserTimeZoneName(); var languageName = window.$gz.locale.getBrowserLanguages(); var hour12 = window.$gz.store.state.locale.hour12; var currencyName = window.$gz.store.state.locale.currencyName; diff --git a/ayanova/src/components/time-control.vue b/ayanova/src/components/time-control.vue index 0149c1ec..b4912ac3 100644 --- a/ayanova/src/components/time-control.vue +++ b/ayanova/src/components/time-control.vue @@ -49,7 +49,7 @@ export default { oldDate: null, dlgtime: false, //cache display format stuff - timeZoneName: window.$gz.locale.getTimeZoneName(), + timeZoneName: window.$gz.locale.getBrowserTimeZoneName(), languageName: window.$gz.locale.getBrowserLanguages(), hour12: window.$gz.locale.getHour12(), defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0] diff --git a/ayanova/src/views/ay-about.vue b/ayanova/src/views/ay-about.vue index bd430771..6de9fd1c 100644 --- a/ayanova/src/views/ay-about.vue +++ b/ayanova/src/views/ay-about.vue @@ -34,7 +34,7 @@
{{ lt("TimeZone") }}: - {{ locale().getTimeZoneName() }} + {{ locale().getBrowserTimeZoneName() }}
diff --git a/ayanova/src/views/home-user-settings.vue b/ayanova/src/views/home-user-settings.vue index d25b8790..d53c3a23 100644 --- a/ayanova/src/views/home-user-settings.vue +++ b/ayanova/src/views/home-user-settings.vue @@ -62,7 +62,7 @@