Skip to content

Support fill, align & width for time point - #3260

Merged
vitaut merged 4 commits into
fmtlib:masterfrom
ShawnZhong:padding
Jan 9, 2023
Merged

vitaut merged 4 commits into
fmtlib:masterfrom
ShawnZhong:padding

Conversation

@ShawnZhong

Copy link
Copy Markdown
Contributor

Resolve #3237

Comment thread include/fmt/chrono.h
auto begin = ctx.begin(), end = ctx.end();
if (begin == end || *begin == '}') return end;

begin = detail::parse_align(begin, end, specs);

@ShawnZhong ShawnZhong Jan 4, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just realized that parse_align(begin, end, specs) is marked as deprecated, should we use parse_format_specs instead?

One thing that doesn't work with parse_format_specs is that an error is thrown on the line enter_state(state::align, align != align::none); since it does not recognize % and falls into default.

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.

It's OK to use parse_align here. It might be easier to clean up and undeprecate parse_align instead of adjusting parse_format_specs but I need to think about it more.

@vitaut

vitaut commented Jan 9, 2023

Copy link
Copy Markdown
Contributor

Thank you!

@ShawnZhong
ShawnZhong deleted the padding branch January 9, 2023 23:13
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.

formatting chrono with padding

2 participants