Consume PocketBase for posts and events, with English routes

This commit is contained in:
tleininger committed 2026-09-23 13:09:22 +02:00
1 parent c59e7a4f83
commit da87716d97
22 files changed
+278 -225

No files matched your search

@@ -1,7 +1,7 @@
using System.Globalization;
using System.Security.Cryptography;
using System.Text;
using Elternbeirat.Web.Services;
using Elternbeirat.Contracts;
namespace Elternbeirat.Web.Features.Events;
@@ -45,7 +45,7 @@ public static class IcsCalendar
// between requests, so caches and clients do not see spurious changes.
AppendLine(sb, "DTSTAMP:20000101T000000Z");
if (ev.HasTime)
if (HasTime(ev))
{
AppendLine(sb, $"DTSTART:{Local(ev.Start)}");
if (ev.End is { } end)
@@ -75,6 +75,12 @@ public static class IcsCalendar
AppendLine(sb, "END:VEVENT");
}
/// <summary>
/// An entry counts as all-day when its start has no wall-clock time (00:00).
/// PocketBase has no separate flag; the convention is a midnight start.
/// </summary>
private static bool HasTime(Event ev) => ev.Start.TimeOfDay != TimeSpan.Zero;
/// <summary>
/// A UID that stays the same as long as the entry's title and start do, so a
/// re-subscribe updates the event instead of creating a duplicate.