From 3aac310a656a2678c0bb39e706ca42fb9742dd28 Mon Sep 17 00:00:00 2001 From: Fenris Wolf Date: Fri, 26 Sep 2025 02:25:41 +0200 Subject: [PATCH] [fix] ics export --- source/helpers.ts | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/source/helpers.ts b/source/helpers.ts index c107659..8899a6d 100644 --- a/source/helpers.ts +++ b/source/helpers.ts @@ -78,30 +78,35 @@ namespace _zeitbild.helpers /** - * @todo timezone */ export function icalendar_dt_from_own_datetime( datetime : lib_plankton.pit.type_datetime ) : lib_plankton.ical.type_dt { + const datetime_normalized : lib_plankton.pit.type_datetime = lib_plankton.pit.to_datetime( + lib_plankton.pit.from_datetime(datetime), + { + "timezone_shift": 0, + } + ); return { - "tzid": "Europe/Berlin", + "tzid": "UTC", "value": { "date": { - "year": datetime.date.year, - "month": datetime.date.month, - "day": datetime.date.day, + "year": datetime_normalized.date.year, + "month": datetime_normalized.date.month, + "day": datetime_normalized.date.day, }, "time": ( - (datetime.time === null) + (datetime_normalized.time === null) ? null : { "utc": true, - "hour": datetime.time.hour, - "minute": datetime.time.minute, - "second": datetime.time.second, + "hour": datetime_normalized.time.hour, + "minute": datetime_normalized.time.minute, + "second": datetime_normalized.time.second, } ) },