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
@@ -68,4 +68,16 @@ public record Event
|
||||
/// </summary>
|
||||
[JsonPropertyName("public")]
|
||||
public bool Public { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the event has a wall-clock time, as opposed
|
||||
/// to being an all-day event.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// PocketBase has no all-day flag; the convention is that a start of 00:00
|
||||
/// means all-day. This is the single definition of that rule -- formatting and
|
||||
/// the calendar feed both read it here instead of re-deriving it.
|
||||
/// </remarks>
|
||||
[JsonIgnore]
|
||||
public bool HasTime => Start.TimeOfDay != TimeSpan.Zero;
|
||||
}
|
||||
Reference in new issue
Block a user