Skip to content

Format a shipping week with the week year - #46

Merged
sabas merged 1 commit into
php-edifact:masterfrom
SashaMIT:codered-shipping-week
Sep 26, 2026
Merged

sabas merged 1 commit into
php-edifact:masterfrom
SashaMIT:codered-shipping-week

Conversation

@SashaMIT

Copy link
Copy Markdown
Contributor

Summary

  • EdifactDate::get('2024-12-30', EdifactDate::SHIPPING_WEEK) returned 202401. Format 616 uses PHP W, the ISO week number, but the year token was Y. 30 December 2024 is a Monday in ISO week 1 of 2025, so the code is 202501.
  • 2020-01-01 still returns 202001.

Test plan

  • ./vendor/bin/phpunit --filter testShippingWeekUsesTheWeekYear failed before the fix (202401 did not match 202501) and passes after it
  • ./vendor/bin/phpunit (34 tests)

Made with Cursor

30 December 2024 was encoded as 202401. That Monday is ISO week 1 of 2025, so the code is 202501. 1 January 2020 stays 202001.
@sabas
sabas merged commit ddffade into php-edifact:master Sep 26, 2026
@SashaMIT

Copy link
Copy Markdown
Contributor Author

Thanks for merging this.

SashaMIT added a commit to SashaMIT/oss-contributions that referenced this pull request Sep 26, 2026
@sabas

sabas commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Thank you for the PR 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants