Skip to content

date: align Thai locale formatting with GNU#12921

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

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

Conversation

@compilersutra

@compilersutra compilersutra commented Jun 16, 2026

Copy link
Copy Markdown

Fix Thai locale formatting so GNU-compatible output is preserved:

  • keep %Y Gregorian under th_TH.UTF-8
  • format %EY, %EC, and %Ey with Buddhist-era values
  • use locale-provided month/day names instead of hardcoded ICU fallbacks
  • skip locale-name tests when the locale is not installed locally

Validation:

  • cargo test --test tests test_date_thai_locale_solar_calendar -- --nocapture
  • cargo test --test tests test_locale_calendar_conversions -- --nocapture
  • cargo test --test tests

Full suite on this machine: 4666 passed, 0 failed, 40 ignored

@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/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/rm/isatty (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/printf/printf-surprise is now 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

@github-actions

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 150.39 MB (-1.03 MB, -0.68%)

Significant per-binary changes:
  date     2.72 MB ->    1.73 MB  (-1008 KB, -36.21%)

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