fix(go): accept single-digit day/month in attendance date headers #22

Merged
kacerr merged 1 commits from fix/go-attendance-date-parser into main 2026-05-07 23:39:03 +02:00
Owner

Summary

parseDates was using "02.01.2006" / "01/02/2006" which require zero-padded fields. The Czech attendance sheet headers contain dates like 1.6.2026, 23.3.2026, 6.4.2026 — Go silently dropped those columns while Python's strptime accepted them.

Effect was a missing 2026-06 month entirely on /api/juniors, plus undercounted attendance for any month containing single-digit columns. Surfaced via make parity.

Fix: use the unpadded reference forms "2.1.2006" / "1/2/2006" — Go's time.Parse accepts both padded and unpadded inputs against them.

Test plan

  • cd go && go test ./internal/services/membership/... (new TestParseDates_SingleDigitDayMonth plus existing tests pass)
  • cd go && golangci-lint run ./internal/services/membership/... clean
  • After merge: restart make web-go; make parity should show fewer diffs (most junior-side discrepancies should be gone; remaining diffs are the vs/sync_id and message/amount type drifts).
## Summary `parseDates` was using `"02.01.2006"` / `"01/02/2006"` which require zero-padded fields. The Czech attendance sheet headers contain dates like `1.6.2026`, `23.3.2026`, `6.4.2026` — Go silently dropped those columns while Python's `strptime` accepted them. Effect was a missing `2026-06` month entirely on `/api/juniors`, plus undercounted attendance for any month containing single-digit columns. Surfaced via `make parity`. Fix: use the unpadded reference forms `"2.1.2006"` / `"1/2/2006"` — Go's `time.Parse` accepts both padded and unpadded inputs against them. ## Test plan - [x] `cd go && go test ./internal/services/membership/...` (new `TestParseDates_SingleDigitDayMonth` plus existing tests pass) - [x] `cd go && golangci-lint run ./internal/services/membership/...` clean - [ ] After merge: restart `make web-go`; `make parity` should show fewer diffs (most junior-side discrepancies should be gone; remaining diffs are the `vs`/`sync_id` and `message`/`amount` type drifts).
kacerr added 1 commit 2026-05-07 23:38:34 +02:00
fix(go): accept single-digit day/month in attendance date headers
All checks were successful
Deploy to K8s / deploy (push) Successful in 8s
56c21bcf03
parseDates was using "02.01.2006" / "01/02/2006" which require
zero-padded fields. The Czech attendance sheet headers contain dates
like "1.6.2026", "23.3.2026", "6.4.2026" — Go silently dropped those
columns while Python's strptime accepted them. Effect was a missing
2026-06 month on /api/juniors plus undercounted attendance in any month
with single-digit columns; surfaced via make parity.

Use the unpadded reference forms "2.1.2006" / "1/2/2006" instead — Go's
time.Parse accepts both padded and unpadded inputs against them.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr merged commit 092dff25a5 into main 2026-05-07 23:39:03 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kacerr/fuj-management#22