From 71d45b36e506a549c01fbc6517a3fee011888855 Mon Sep 17 00:00:00 2001 From: lesion Date: Thu, 13 Apr 2023 21:48:23 +0200 Subject: [PATCH] set ics timezone, fix #258 --- server/api/controller/export.js | 4 ++-- server/api/models/event.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/api/controller/export.js b/server/api/controller/export.js index 50e6d1e3..310744de 100644 --- a/server/api/controller/export.js +++ b/server/api/controller/export.js @@ -97,7 +97,7 @@ const exportController = { const settings = res.locals.settings const eventsMap = events.map(e => { - const tmpStart = DateTime.fromSeconds(e.start_datetime) + const tmpStart = DateTime.fromSeconds(e.start_datetime, { zone: settings.instance_timezone }) const start = [ tmpStart.year, tmpStart.month, tmpStart.day, tmpStart.hour, tmpStart.minute ] const ret = { @@ -114,7 +114,7 @@ const exportController = { } if (e.end_datetime) { - const tmpEnd = DateTime.fromSeconds(e.end_datetime) + const tmpEnd = DateTime.fromSeconds(e.end_datetime, { zone: settings.instance_timezone }) const end = [ tmpEnd.year, tmpEnd.month, tmpEnd.day, tmpEnd.hour, tmpEnd.minute ] ret.end = end } diff --git a/server/api/models/event.js b/server/api/models/event.js index b2e29430..c3f028fc 100644 --- a/server/api/models/event.js +++ b/server/api/models/event.js @@ -46,7 +46,7 @@ module.exports = (sequelize, DataTypes) => { const plainDescription = htmlToText(this.description && this.description.replace('\n', '').slice(0, 1000)) const content = ` 📍 ${this.place && this.place.name} - 📅 ${DateTime.fromSeconds(this.start_datetime).toFormat('EEEE, d MMMM (HH:mm)')} + 📅 ${DateTime.fromSeconds(this.start_datetime, opt).toFormat('EEEE, d MMMM (HH:mm)')} ${plainDescription} `