This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user