This commit is contained in:
2021-09-17 22:30:52 +00:00
parent 3d7626f1e9
commit 346b27ac1d
2 changed files with 36 additions and 4 deletions

View File

@@ -101,6 +101,26 @@ export default {
})
).getTime();
},
///////////////////////////////////////////////
// Convert a local schedule epoch timestamp
// to UTC and output as ISO 8601
//
//
localScheduleFormatToUTC8601String(value, timeZoneName) {
if (!timeZoneName) {
timeZoneName = this.getResolvedTimeZoneName();
}
//parse in the time in the currently used timezone
let ret = window.$gz.DateTime.fromMillis(value, {
zone: timeZoneName
});
ret = ret.setZone("utc"); //convert to UTC
ret = ret.toISO(); //output as ISO 8601
return ret;
},
///////////////////////////////////////////
// Turn a utc date into a displayable
// short date and time

View File

@@ -392,13 +392,25 @@ export default {
if (this.dragEvent) {
param.type = this.dragEvent.type;
param.id = this.dragEvent.id;
(param.start = this.dragEvent.start),
(param.end = this.dragEvent.end);
param.start = window.$gz.locale.localScheduleFormatToUTC8601String(
this.dragEvent.start,
this.timeZoneName
);
param.end = window.$gz.locale.localScheduleFormatToUTC8601String(
this.dragEvent.end,
this.timeZoneName
);
} else {
param.type = this.extendEvent.type;
param.id = this.extendEvent.id;
(param.start = this.extendEvent.start),
(param.end = this.extendEvent.end);
param.start = window.$gz.locale.localScheduleFormatToUTC8601String(
this.extendEvent.start,
this.timeZoneName
);
param.end = window.$gz.locale.localScheduleFormatToUTC8601String(
this.extendEvent.end,
this.timeZoneName
);
}
//post it