mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
fix #258 without setting TZ env
This commit is contained in:
parent
8605788d64
commit
be4b5eeb67
1 changed files with 4 additions and 2 deletions
|
@ -97,12 +97,14 @@ const exportController = {
|
||||||
const settings = res.locals.settings
|
const settings = res.locals.settings
|
||||||
const eventsMap = events.map(e => {
|
const eventsMap = events.map(e => {
|
||||||
|
|
||||||
const tmpStart = DateTime.fromSeconds(e.start_datetime, { zone: settings.instance_timezone })
|
const tmpStart = DateTime.fromSeconds(e.start_datetime, { zone: 'UTC' })
|
||||||
const start = [ tmpStart.year, tmpStart.month, tmpStart.day, tmpStart.hour, tmpStart.minute ]
|
const start = [ tmpStart.year, tmpStart.month, tmpStart.day, tmpStart.hour, tmpStart.minute ]
|
||||||
|
|
||||||
const ret = {
|
const ret = {
|
||||||
uid: `${e.id}@${settings.hostname}`,
|
uid: `${e.id}@${settings.hostname}`,
|
||||||
start,
|
start,
|
||||||
|
startInputType: 'utc',
|
||||||
|
endInputType: 'utc',
|
||||||
title: `[${settings.title}] ${e.title}`,
|
title: `[${settings.title}] ${e.title}`,
|
||||||
description: htmlToText(e.description),
|
description: htmlToText(e.description),
|
||||||
htmlContent: e.description,
|
htmlContent: e.description,
|
||||||
|
@ -114,7 +116,7 @@ const exportController = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.end_datetime) {
|
if (e.end_datetime) {
|
||||||
const tmpEnd = DateTime.fromSeconds(e.end_datetime, { zone: settings.instance_timezone })
|
const tmpEnd = DateTime.fromSeconds(e.end_datetime, { zone: 'UTC' })
|
||||||
const end = [ tmpEnd.year, tmpEnd.month, tmpEnd.day, tmpEnd.hour, tmpEnd.minute ]
|
const end = [ tmpEnd.year, tmpEnd.month, tmpEnd.day, tmpEnd.hour, tmpEnd.minute ]
|
||||||
ret.end = end
|
ret.end = end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue