diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index d6fa4af0..e6de58e4 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -8,21 +8,16 @@ MISC ITEMS THAT CAME UP -TODO: TIME PICKER IS FUCKED UP WHEN FORCE TIMEZONE!! LISTVIEW REPLACE CURRENT <----HERE not THERE ---v (below this is all past for reference) TODO (now) + +TODO: TIME PICKER IS FUCKED UP WHEN FORCE TIMEZONE!! + - SERVER - DataListSqlFilterCriteriaBuilder - modify to handle date tokens using client timestamp (old filter code already put back in comment form) - API docs - remove the outdated stuff if listview and specs are documented - no need to document the listview shit, let people figure it out if they have to, seems like something we don't need to push out there - as it's our UI specific and they can easily figure it out from the api explorer and examine the fetch ops from client - - CLIENT Implement filter buttons for mobile mode diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index c9d76a98..50305548 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -165,6 +165,7 @@ export default { if (!timeZoneName) { timeZoneName = this.getResolvedTimeZoneName(); } + return new Date(value).toLocaleTimeString("sv-SE", { timeZone: timeZoneName }); @@ -180,22 +181,32 @@ export default { if (!timeZoneName) { timeZoneName = this.getResolvedTimeZoneName(); } + //parse in the time in the currently used timezone - return window.$gz.DateTime.fromISO(value, { - zone: this.timeZoneName - }) - .setZone("utc") //convert to UTC - .toISO(); //output as ISO 8601 + let ret = window.$gz.DateTime.fromISO(value, { + zone: timeZoneName + }); + + ret = ret.setZone("utc"); //convert to UTC + ret = ret.toISO(); //output as ISO 8601 + + return ret; }, /////////////////////////////////////////////// // UTC Now in api format // to UTC and output as ISO 8601 // (used to set defaults) // - nowUTC8601String() { - return window.$gz.DateTime.local() + + nowUTC8601String(timeZoneName) { + if (!timeZoneName) { + timeZoneName = this.getResolvedTimeZoneName(); + } + let ret = window.$gz.DateTime.local() + .setZone(timeZoneName) .toUTC() .toString(); + return ret; }, /////////////////////////////////////////////// // Local now timestamp converted to timeZoneName diff --git a/ayanova/src/components/date-time-control.vue b/ayanova/src/components/date-time-control.vue index eaf66ab0..72cef664 100644 --- a/ayanova/src/components/date-time-control.vue +++ b/ayanova/src/components/date-time-control.vue @@ -165,7 +165,6 @@ export default { }, updateValue(theDate, theTime) { let vm = this; - if (!theDate) { let v = new Date(); let fullYear = v.getFullYear(); diff --git a/ayanova/src/components/time-control.vue b/ayanova/src/components/time-control.vue index 8f015a19..f6f76e3f 100644 --- a/ayanova/src/components/time-control.vue +++ b/ayanova/src/components/time-control.vue @@ -95,7 +95,9 @@ export default { }, methods: { setNow() { - let v = window.$gz.locale.nowUTC8601String().split("T")[1]; + let v = window.$gz.locale + .nowUTC8601String(this.timeZoneName) + .split("T")[1]; this.updateTimeValue(v); this.dlgtime = false; },