feat: add %V format code for ISO 8601 week number#128
Merged
atoomic merged 1 commit intoApr 29, 2026
Conversation
Add format_V() implementing ISO 8601 week numbering (01-53), where week 1 contains the year's first Thursday and weeks start on Monday. Handles year-boundary edge cases: dates in early January that belong to the previous year's last week (52 or 53), and late December dates that belong to week 1 of the next year. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
atoomic
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
%V— ISO 8601 week number (01-53) — to the strftime/time2str format codes.Why
%Vis a standard POSIX strftime code that was missing from TimeDate. ISO week numbering is widely used in European business contexts, logistics, and project planning. Without it, users had to compute the ISO week number manually.How
New
format_V()inDate::Format::Genericusing the Thursday-based ISO 8601 algorithm. Handles the tricky year-boundary cases:Testing
t/iso-week-number.twith 18 test cases covering:🤖 Generated with Claude Code
Quality Report
Changes: 3 files changed, 75 insertions(+)
Code scan: clean
Tests: skipped
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline