This commit is contained in:
2021-02-05 20:16:05 +00:00
parent 76d82ee9c4
commit fb779c39ef
4 changed files with 24 additions and 17 deletions

View File

@@ -8,7 +8,6 @@
MISC ITEMS THAT CAME UP MISC ITEMS THAT CAME UP
TODO: TIME PICKER IS FUCKED UP WHEN FORCE TIMEZONE!!
LISTVIEW REPLACE CURRENT <----HERE not THERE ---v LISTVIEW REPLACE CURRENT <----HERE not THERE ---v
@@ -16,11 +15,7 @@ LISTVIEW REPLACE CURRENT <----HERE not THERE ---v
TODO (now) TODO (now)
SERVER TODO: TIME PICKER IS FUCKED UP WHEN FORCE TIMEZONE!!
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 CLIENT

View File

@@ -165,6 +165,7 @@ export default {
if (!timeZoneName) { if (!timeZoneName) {
timeZoneName = this.getResolvedTimeZoneName(); timeZoneName = this.getResolvedTimeZoneName();
} }
return new Date(value).toLocaleTimeString("sv-SE", { return new Date(value).toLocaleTimeString("sv-SE", {
timeZone: timeZoneName timeZone: timeZoneName
}); });
@@ -180,22 +181,32 @@ export default {
if (!timeZoneName) { if (!timeZoneName) {
timeZoneName = this.getResolvedTimeZoneName(); timeZoneName = this.getResolvedTimeZoneName();
} }
//parse in the time in the currently used timezone //parse in the time in the currently used timezone
return window.$gz.DateTime.fromISO(value, { let ret = window.$gz.DateTime.fromISO(value, {
zone: this.timeZoneName zone: timeZoneName
}) });
.setZone("utc") //convert to UTC
.toISO(); //output as ISO 8601 ret = ret.setZone("utc"); //convert to UTC
ret = ret.toISO(); //output as ISO 8601
return ret;
}, },
/////////////////////////////////////////////// ///////////////////////////////////////////////
// UTC Now in api format // UTC Now in api format
// to UTC and output as ISO 8601 // to UTC and output as ISO 8601
// (used to set defaults) // (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() .toUTC()
.toString(); .toString();
return ret;
}, },
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Local now timestamp converted to timeZoneName // Local now timestamp converted to timeZoneName

View File

@@ -165,7 +165,6 @@ export default {
}, },
updateValue(theDate, theTime) { updateValue(theDate, theTime) {
let vm = this; let vm = this;
if (!theDate) { if (!theDate) {
let v = new Date(); let v = new Date();
let fullYear = v.getFullYear(); let fullYear = v.getFullYear();

View File

@@ -95,7 +95,9 @@ export default {
}, },
methods: { methods: {
setNow() { 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.updateTimeValue(v);
this.dlgtime = false; this.dlgtime = false;
}, },