Skip to content

allow %x for formatting year_month_day - #2762

Merged
Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:mainfrom
fsb4000:fix2761
Jun 16, 2022
Merged

allow %x for formatting year_month_day#2762
Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:mainfrom
fsb4000:fix2761

Conversation

@fsb4000

Copy link
Copy Markdown
Contributor

Fixes #2761

I'm not sure if it's correct.

C++ standard is unclear: https://eel.is/c++draft/time.format#6

But cppreference says that %x is supported for year_month_day, year_month_day_last, year_month_weekday and year_month_weekday_last

@fsb4000
Igor Zhukov (fsb4000) requested a review from a team as a code owner June 5, 2022 18:05
@CaseyCarter Casey Carter (CaseyCarter) added bug Something isn't working format C++20/23 format labels Jun 5, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

I believe that this is correct (although the Standard is unusually elliptical in this area, these types do provide the necessary information).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Ideally, we would test the locale specific orderings, but with current test coverage this looks like a strict improvement, even if the locale stuff were to be broken so I don't feel it needs those tests to be merged.

@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 8fca26f into microsoft:main Jun 16, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for fixing this chronat bug! πŸ“… ✏️ πŸŽ‰

@fsb4000
Igor Zhukov (fsb4000) deleted the fix2761 branch June 16, 2022 04:01
Igor Zhukov (fsb4000) added a commit to fsb4000/STL that referenced this pull request Aug 13, 2022
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working chrono C++20 chrono format C++20/23 format

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<chrono>: formatter<chrono::year_month_day> is not fully implemented.

4 participants