This commit is contained in:
Fenris Wolf 2024-09-10 07:55:01 +02:00
parent 94485919a7
commit 49b0da5f5b
2 changed files with 16 additions and 1 deletions

View file

@ -60,7 +60,14 @@ function datetime_from_date_object(
}, },
options options
); );
const date_ : Date = new Date(date.getTime() + (((options.timezone_shift as int) * (60 * 60)) * 1000)); const date_ : Date = lib_plankton.call.convey(
date,
[
(x : Date) => x.getTime(),
(x : int) => (x + (((options.timezone_shift as int) * (60 * 60)) * 1000)),
(x : int) => new Date(x),
]
);
const iso_string : string = date_.toISOString(); const iso_string : string = date_.toISOString();
return { return {
"timezone_shift": (options.timezone_shift as int), "timezone_shift": (options.timezone_shift as int),

View file

@ -244,6 +244,7 @@ async function calendar_gather_events(
"headers": {}, "headers": {},
"body": null, "body": null,
}; };
// TODO: cache?
const http_response : lib_plankton.http.type_response = await lib_plankton.http.call( const http_response : lib_plankton.http.type_response = await lib_plankton.http.call(
http_request, http_request,
{ {
@ -291,6 +292,13 @@ async function calendar_gather_events(
.filter( .filter(
(event) => (event !== null) (event) => (event !== null)
) )
.filter(
(event) => pit_is_between(
pit_from_datetime(event.begin),
from_pit,
to_pit
)
)
.map( .map(
(event) => ({"calendar_id": calendar_id, "event": event}) (event) => ({"calendar_id": calendar_id, "event": event})
) )