Skip to content

fix: add French day ordinal suffix in format_o#60

Draft
Koan-Bot wants to merge 1 commit intoatoomic:mainfrom
Koan-Bot:koan.atoomic/fix-french-format-o
Draft

fix: add French day ordinal suffix in format_o#60
Koan-Bot wants to merge 1 commit intoatoomic:mainfrom
Koan-Bot:koan.atoomic/fix-french-format-o

Conversation

@Koan-Bot
Copy link

@Koan-Bot Koan-Bot commented Mar 13, 2026

What

Fix format_o in Date::Language::French to return ordinal day numbers with French suffixes ("1er", "2e", etc.) instead of bare numbers.

Why

French was the only language module where format_o returned just the day number — all others include language-appropriate suffixes. Originally reported as rt.cpan.org#128396 (issue #22) and previously attempted in PR #54, which went stale due to encoding issues from being based on pre-modernization code.

How

  • Fixed @Dsuf off-by-one: array was indexed starting at 0 with "er", but format_o indexes by day number (1-31). Index 0 is now an unused placeholder, index 1 = "er" (premier), indices 2-31 = "e".
  • Changed format_o from $_[0]->[3] to sprintf("%2d%s",$_[0]->[3],$Dsuf[$_[0]->[3]]) — same pattern used by German, Dutch, Swedish, and other language modules.

Testing

Closes #22
Supersedes #54

🤖 Generated with Claude Code


Quality Report

Changes: 2 files changed, 46 insertions(+), 3 deletions(-)

Code scan: clean

Tests: skipped

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

French format_o was returning bare day numbers while all other language
modules include ordinal suffixes. Fixed format_o to use @Dsuf and
corrected @Dsuf array indexing (was off-by-one: index 0 should be
unused placeholder since days are 1-31).

Results: "1er", "2e", "3e", ..., "31e" — following French convention.

Closes atoomic#22

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Date::Language::French - patch for day suffixes [rt.cpan.org #128396]

1 participant