Skip to content

Improve whitespace handling in Time::Format #15890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

HertzDevil
Copy link
Contributor

  • Adds support for %n and %t. They are exactly equivalent to \n and \t, as in POSIX C strptime (when _XOPEN_SOURCE is defined) and Ruby Time.strptime.
  • All ASCII whitespace characters in the pattern now consume zero or more ASCII whitespace characters when parsing. This includes %n, %t, and the embedded spaces in %c and %r too.
  • The YAML timestamp specification only allows the space character and the tab character ([ \t]+), any other whitespace is now disallowed.

@straight-shoota straight-shoota added this to the 1.17.0 milestone Jun 10, 2025
@straight-shoota straight-shoota merged commit 8be0116 into crystal-lang:master Jun 12, 2025
39 checks passed
@HertzDevil HertzDevil deleted the feature/time-format-space branch June 12, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants