Read a post's date as the Berlin calendar day, not the raw UTC day
This commit is contained in:
1 parent
aef05fb090
commit
6d3260db49
6 files changed
+76
-8
No files matched your search
@@ -1,3 +1,4 @@
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Elternbeirat.Contracts;
|
||||
@@ -17,14 +18,16 @@ public record Post
|
||||
public string Id { get; init; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the publication date as Europe/Berlin wall-clock time.
|
||||
/// Gets the publication date as a calendar day.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// PocketBase stores the value in UTC; it is converted to Berlin local time on
|
||||
/// deserialization, with daylight saving applied. Only the date part is shown.
|
||||
/// A post's date is a plain day, not a point in time. It is read as the
|
||||
/// Berlin calendar day: the UTC value is converted to Europe/Berlin and only
|
||||
/// the day is kept, so the day an editor picked is the day shown -- no
|
||||
/// time-of-day, no off-by-one at midnight. See <see cref="DateOnlyConverter"/>.
|
||||
/// </remarks>
|
||||
[JsonPropertyName("date")]
|
||||
public DateTime Date { get; init; }
|
||||
public DateOnly Date { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the heading shown to visitors.
|
||||
|
||||
Reference in new issue
Block a user