Skip to content

Fix builtin time format locale#744

Merged
appel1 merged 2 commits into
developfrom
fix/builtin-time-format-locale
May 24, 2026
Merged

Fix builtin time format locale#744
appel1 merged 2 commits into
developfrom
fix/builtin-time-format-locale

Conversation

@appel1

@appel1 appel1 commented May 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes #432

@appel1 appel1 closed this May 24, 2026
@appel1 appel1 deleted the fix/builtin-time-format-locale branch May 24, 2026 19:00
@appel1 appel1 restored the fix/builtin-time-format-locale branch May 24, 2026 19:03
@appel1 appel1 reopened this May 24, 2026
appel1 added 2 commits May 24, 2026 21:54
…20 and 21

Extend GetBuiltinNumberFormat(numFmtId, provider) to derive format strings
for built-in indices 20 (h:mm) and 21 (h:mm:ss) from the provider's
ShortTimePattern and LongTimePattern respectively, consistent with how
index 22 already derives its time component.

Also update Issue461.xlsx to include cells with numFmtId 20 and 21,
and add corresponding tests.
… on 12h locales

Indices 20 (h:mm) and 21 (h:mm:ss) are explicitly non-AM/PM formats.
On 12h locales like en-US, deriving from ShortTimePattern/LongTimePattern
would incorrectly add AM/PM. Fall back to the hardcoded spec string when
the derived pattern contains AM/PM or A/P.

Verified against Excel: de-DE gives hh:mm/hh:mm:ss, en-US gives h:mm/h:mm:ss.
@appel1 appel1 force-pushed the fix/builtin-time-format-locale branch from 72fb917 to 00896f9 Compare May 24, 2026 19:57
@appel1 appel1 merged commit 8728178 into develop May 24, 2026
2 checks passed
@appel1 appel1 deleted the fix/builtin-time-format-locale branch May 24, 2026 20:07
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.

"Custom" Date format in excel

1 participant