Skip to content

date: align Thai locale formatting with GNU#12921

Open
compilersutra wants to merge 5 commits into
uutils:mainfrom
compilersutra:fix/date-thai-locale-gnu-parity
Open

date: align Thai locale formatting with GNU#12921
compilersutra wants to merge 5 commits into
uutils:mainfrom
compilersutra:fix/date-thai-locale-gnu-parity

Conversation

@compilersutra

Copy link
Copy Markdown

Fix Thai locale formatting in date to match GNU coreutils.

Behavior after this patch:

  • %Y stays Gregorian
  • %EY also stays Gregorian for th_TH.UTF-8
  • month/day names follow the active locale data and now match GNU output

Verified with:

  • cargo build -p coreutils --bin coreutils
  • cargo test -p coreutils test_date_thai_locale_solar_calendar -- --nocapture
  • cargo test -p coreutils test_locale_calendar_conversions -- --nocapture
  • direct comparison against /home/aitr/rust_bugs/gnucoreutils/src/date

Refs: #12891

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/date/date-thailand. tests/date/date-thailand is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.

@compilersutra

Copy link
Copy Markdown
Author

I found a conflict with tests/date/date-thailand.sh: GNU expects Thai solar-calendar output for date +%Y and Thai month names, but this patch makes the Thai locale Gregorian/
English for -d too. Should I narrow the fix to preserve the GNU test behavior, or is changing that GNU test expected?

@sylvestre

Copy link
Copy Markdown
Contributor

You should match what gnu is doing. Thanks

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