Convert PocketBase dates to Berlin time; document code conventions
This commit is contained in:
1 parent
4b93434679
commit
aef05fb090
11 files changed
+406
-129
No files matched your search
@@ -23,14 +23,15 @@ public sealed class PocketBaseClientTests(PocketBaseFixture pocketBase)
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Event_time_is_read_as_wall_clock_not_shifted()
|
||||
public async Task Event_utc_is_converted_to_berlin_wall_clock()
|
||||
{
|
||||
var client = pocketBase.CreateClient();
|
||||
|
||||
var events = await client.GetEventsAsync();
|
||||
|
||||
// The meeting is seeded as 19:30; by the timezone convention the number is
|
||||
// taken at face value, so no shift to 20:30/21:30 happens.
|
||||
// The meeting is seeded as 17:30Z. October is summer time (UTC+2), so the
|
||||
// converter turns it into 19:30 Berlin wall-clock -- the time an editor
|
||||
// entered in the admin form.
|
||||
var meeting = events.FirstOrDefault(e =>
|
||||
e.Title.Contains("Elternbeiratssitzung", StringComparison.Ordinal));
|
||||
meeting.ShouldNotBeNull();
|
||||
|
||||
@@ -295,15 +295,18 @@ public sealed class PocketBaseFixture : IAsyncLifetime
|
||||
body = "Text", slug = "new-hall", @public = true,
|
||||
});
|
||||
|
||||
// Events: the meeting carries the wall-clock time the timezone test checks.
|
||||
// Events: PocketBase stores UTC. The meeting is 19:30 Berlin; October is
|
||||
// summer time (UTC+2), so it is stored as 17:30Z and the timezone test
|
||||
// expects 19:30 back. The Herbstbasar is 09:00-13:00 Berlin in November
|
||||
// (winter, UTC+1), stored as 08:00Z-12:00Z.
|
||||
await CreateRecordAsync(http, "events", new
|
||||
{
|
||||
start = "2026-10-08 19:30:00.000Z", title = "Elternbeiratssitzung",
|
||||
start = "2026-10-08 17:30:00.000Z", title = "Elternbeiratssitzung",
|
||||
location = "Aula", note = "", @public = true,
|
||||
});
|
||||
await CreateRecordAsync(http, "events", new
|
||||
{
|
||||
start = "2026-11-22 09:00:00.000Z", end = "2026-11-22 13:00:00.000Z",
|
||||
start = "2026-11-22 08:00:00.000Z", end = "2026-11-22 12:00:00.000Z",
|
||||
title = "Herbstbasar", location = "Schulhof", note = "", @public = true,
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user