This commit is contained in:
Fenris Wolf 2024-10-10 20:24:05 +02:00
parent 62af4bf485
commit a9acb81f4a
7 changed files with 67 additions and 2 deletions

View file

@ -42,6 +42,7 @@
"events": [ "events": [
{ {
"name": "Aufstand: Mieten", "name": "Aufstand: Mieten",
"public": false,
"begin": { "begin": {
"timezone_shift": 2, "timezone_shift": 2,
"date": {"year": 2024, "month": 10, "day": 14}, "date": {"year": 2024, "month": 10, "day": 14},
@ -57,6 +58,7 @@
}, },
{ {
"name": "Aufstand: Waffen", "name": "Aufstand: Waffen",
"public": false,
"begin": { "begin": {
"timezone_shift": 2, "timezone_shift": 2,
"date": {"year": 2024, "month": 10, "day": 21}, "date": {"year": 2024, "month": 10, "day": 21},
@ -72,6 +74,7 @@
}, },
{ {
"name": "Aufstand: Essen", "name": "Aufstand: Essen",
"public": false,
"begin": { "begin": {
"timezone_shift": 2, "timezone_shift": 2,
"date": {"year": 2024, "month": 11, "day": 28}, "date": {"year": 2024, "month": 11, "day": 28},
@ -111,6 +114,7 @@
"events": [ "events": [
{ {
"name": "Feier: Bier", "name": "Feier: Bier",
"public": false,
"begin": { "begin": {
"timezone_shift": 2, "timezone_shift": 2,
"date": {"year": 2024, "month": 10, "day": 18}, "date": {"year": 2024, "month": 10, "day": 18},
@ -126,6 +130,7 @@
}, },
{ {
"name": "Feier: Schnapps", "name": "Feier: Schnapps",
"public": false,
"begin": { "begin": {
"timezone_shift": 2, "timezone_shift": 2,
"date": {"year": 2024, "month": 11, "day": 1}, "date": {"year": 2024, "month": 11, "day": 1},
@ -161,6 +166,7 @@
"events": [ "events": [
{ {
"name": "Aufräumen: Flaschen", "name": "Aufräumen: Flaschen",
"public": false,
"begin": { "begin": {
"timezone_shift": 2, "timezone_shift": 2,
"date": {"year": 2024, "month": 10, "day": 24}, "date": {"year": 2024, "month": 10, "day": 24},
@ -200,6 +206,7 @@
"events": [ "events": [
{ {
"name": "Infostand", "name": "Infostand",
"public": false,
"begin": { "begin": {
"timezone_shift": 2, "timezone_shift": 2,
"date": {"year": 2024, "month": 10, "day": 16}, "date": {"year": 2024, "month": 10, "day": 16},

View file

@ -5,7 +5,7 @@ namespace _zeitbild.database
/** /**
*/ */
const _compatible_revisions : Array<string> = [ const _compatible_revisions : Array<string> = [
"r1", "r2",
]; ];

View file

@ -97,7 +97,17 @@ async function data_init(
/*const event_ids : Array<_zeitbild.type_local_resource_event_id> = */await Promise.all( /*const event_ids : Array<_zeitbild.type_local_resource_event_id> = */await Promise.all(
calendar_raw.resource.data.events calendar_raw.resource.data.events
.map( .map(
(event_raw : _zeitbild.type_event_object) => _zeitbild.service.resource.event_add(resource_id, event_raw) (event_raw : _zeitbild.type_event_object) => _zeitbild.service.resource.event_add(
resource_id,
{
"name": event_raw["name"],
"public": (event_raw["public"] ?? false),
"begin": event_raw["begin"],
"end": (event_raw["end"] ?? null),
"location": (event_raw["location"] ?? null),
"description": (event_raw["description"] ?? null),
}
)
) )
); );
break; break;

View file

@ -217,6 +217,7 @@ namespace _zeitbild.repository.resource
return { return {
"local_resource_id": stuff.local_resource_id, "local_resource_id": stuff.local_resource_id,
"name": stuff.event.name, "name": stuff.event.name,
"public": stuff.event.public,
"begin": encode_datetime(stuff.event.begin), "begin": encode_datetime(stuff.event.begin),
"end": ( "end": (
(stuff.event.end === null) (stuff.event.end === null)
@ -271,6 +272,7 @@ namespace _zeitbild.repository.resource
"local_resource_id": row["local_resource_id"], "local_resource_id": row["local_resource_id"],
"event": { "event": {
"name": row["name"], "name": row["name"],
"public": row["public"],
"begin": decode_datetime(row["begin"]), "begin": decode_datetime(row["begin"]),
"end": ( "end": (
(row["end"] === null) (row["end"] === null)

View file

@ -0,0 +1,44 @@
SELECT
id AS id,
name AS name
FROM
calendars
WHERE
(
resource_id
IN
(
SELECT
id
FROM
resources
WHERE
(
(
(kind = 'local')
AND
(
sub_id
IN
(
SELECT
local_resource_id
FROM
local_resource_events
WHERE
(public = TRUE)
/*
GROUP BY
local_resource_id
*/
)
)
)
OR
(
(kind = 'caldav')
)
)
)
)
;

View file

@ -342,6 +342,7 @@ namespace _zeitbild.service.calendar
: :
"???" "???"
), ),
"public": true, // todo?
"begin": _zeitbild.helpers.ical_dt_to_own_datetime(vevent.dtstart), "begin": _zeitbild.helpers.ical_dt_to_own_datetime(vevent.dtstart),
"end": ( "end": (
(vevent.dtend !== undefined) (vevent.dtend !== undefined)

View file

@ -35,6 +35,7 @@ namespace _zeitbild
*/ */
export type type_event_object = { export type type_event_object = {
name : string; name : string;
public : boolean;
begin : lib_plankton.pit.type_datetime; begin : lib_plankton.pit.type_datetime;
end : ( end : (
null null