Read a post's date as the Berlin calendar day, not the raw UTC day

This commit is contained in:
tleininger committed 2026-09-24 09:11:37 +02:00
1 parent aef05fb090
commit 6d3260db49
6 files changed
+76 -8

No files matched your search

@@ -64,6 +64,20 @@ public sealed class PocketBaseClientTests(PocketBaseFixture pocketBase)
posts.Select(p => p.Title).ShouldBe(["Neuer Vorstand", "Neue Sporthalle"]);
}
[Fact]
public async Task Post_date_is_the_berlin_calendar_day()
{
var client = pocketBase.CreateClient();
var posts = await client.GetPostsAsync();
// The post is seeded as 2026-03-01 23:30Z, which is 2 March 00:30 in Berlin.
// The date is the Berlin day the editor picked (2 March), not the raw UTC
// day (1 March) -- the time zone is applied before the day is taken.
var post = posts.Single(p => p.Title == "Neuer Vorstand");
post.Date.ShouldBe(new DateOnly(2026, 3, 2));
}
[Fact]
public async Task Pages_exclude_non_public_records()
{