Time: ISO 8601 stamps, civil dates and the captions

imsd renders the service centre's time stamp of a text as ISO 8601 with
the centre's offset and adds the arrival epoch; the captions need the
user's local day and clock. The parser is hand-rolled, with the
calendar's own check of the date (a 30th of February is no date); the
civil dates, the weekdays and the month names are std::chrono's calendar
and its formatting; every caption takes the local offset of the instant
as an argument, so nothing here depends on a time zone database and the
tests inject the offsets.

Tested: tests/Time, the KPN bench stamp in five spellings, rejected
garbage and days the month does not have, the day and list captions
around midnight and across a year.
This commit is contained in:
Jorijn van der Graaf 2026-10-17 23:25:38 +02:00
commit 2a833b0bad
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
3 changed files with 215 additions and 0 deletions

View file

@ -134,6 +134,7 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
ApplyGioFlags(cfg);
cfg.AddTest("Number").Dependencies({ Core.get() });
cfg.AddTest("Time").Dependencies({ Core.get() });
LintRules::AddRules(cfg);
return cfg;