4 Commits

Author SHA1 Message Date
Roland Reichwein
b14f70698f
Fix chrono.h year_month_weekday_last and year_month_weekday sysdays() (#1396)
* Print test names at test time (#1343)

* Fix chrono.h year_month_weekday_last and year_month_weekday sysdays()

Bug 1: year_month_weekday_last::operator sys_days() — wrong weekday construction

The code was constructing a weekday from a raw day count using weekday(unsigned),
which treats the value as a weekday encoding (0–6). The fix uses weekday(sys_days),
which correctly accounts for the epoch being a Thursday (+4 offset).

Bug 2: year_month_weekday::operator sys_days() — same wrong weekday
construction + off-by-one in day_of_month

Same weekday(unsigned) vs weekday(sys_days) issue. Additionally, the day_of_month
calculation was missing the 1 + base — it computed a 0-based offset from day 1,
but forgot to add the 1 back when converting to an actual day number.

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-04-14 11:48:03 +02:00
John Wellbelove
aeb8e4f734 Formatted source files 2026-04-02 14:11:45 +01:00
John Wellbelove
d884719098 Fixed all 'extra semicolon' warnings 2025-12-16 09:15:26 +00:00
John Wellbelove
ba31479481 Added sys_day and local_day constructors and conversions 2025-05-17 21:00:23 +01:00