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, } ) },