Skip to content

Conversation

@tiffany352
Copy link
Contributor

@tiffany352 tiffany352 commented Jul 30, 2025

Based on the discussion here: tiffany352/rink-rs#210

set_meridiem seems to have been left out originally because it's not used for formatting. But it is needed for doing custom parsing, so I'm adding it here.

Should the meridiem should be used during formatting? The fmt_hour* functions could be updated to call hour_ranged() instead of reading the hour field directly.

I'm not sure why I didn't add this originally. There is some confusion
around what happens when the hour value is inconsistent with the
meridiem, but that could already happen when parsing. And in that case,
the meridiem takes precedence over the parsed hour value. So we do the
same when formatting too.

Ref tiffany352/rink-rs#210 (review)

PR BurntSushi#397
@BurntSushi BurntSushi force-pushed the add-brokendownparts-setmeridiem branch from 8a5193f to 48b9d8e Compare September 28, 2025 13:28
@BurntSushi BurntSushi merged commit 99545c6 into BurntSushi:master Sep 28, 2025
38 checks passed
@BurntSushi
Copy link
Owner

Should the meridiem should be used during formatting? The fmt_hour* functions could be updated to call hour_ranged() instead of reading the hour field directly.

I think this makes sense. I updated the PR to do exactly this. :-)

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