Define the all-day rule once as Event.HasTime
This commit is contained in:
1 parent
31b114982e
commit
66bc76af1c
4 files changed
+87
-57
No files matched your search
@@ -45,7 +45,7 @@ public static class IcsCalendar
|
||||
// between requests, so caches and clients do not see spurious changes.
|
||||
AppendLine(sb, "DTSTAMP:20000101T000000Z");
|
||||
|
||||
if (HasTime(ev))
|
||||
if (ev.HasTime)
|
||||
{
|
||||
AppendLine(sb, $"DTSTART:{Local(ev.Start)}");
|
||||
if (ev.End is { } end)
|
||||
@@ -75,12 +75,6 @@ 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.
|
||||
|
||||
Reference in new issue
Block a user