Skip to content
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

Small fixes to the RFC 3339 parsers #1145

Merged
merged 9 commits into from
Aug 29, 2023

Commits on Aug 29, 2023

  1. Fix rfc* tests with leap second

    The result of `checked_add_signed` will never be a leap second, so
    it is not suitable for creating test values with leap seconds.
    pitdicker committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    21d9301 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    36d802c View commit details
    Browse the repository at this point in the history
  3. RFC 3339: accept space as separator between date and time

    From the standard:
    > NOTE: ISO 8601 defines date and time separated by "T". Applications using
    > this syntax may choose, for the sake of readability, to specify a full-date
    > and full-time separated by (say) a space character.
    
    The permissive parser already accepted a space, now the strict parser also
    accepts it.
    The vague wording suggest more characters than 'T' and ' ' might be allowed,
    but I have stopped at adding just a space.
    pitdicker committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    e168046 View commit details
    Browse the repository at this point in the history
  4. Extract relaxed RFC 3339 parser from FromStr impl for DateTime

    This allows us to start using the permissive parser for the `RFC3339` item,
    which matches the documentation more closely.
    pitdicker committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    8387184 View commit details
    Browse the repository at this point in the history
  5. Don't consume trailing whitespace in parse_rfc3339_relaxed

    When used for the `RFC3339` formatting item it should not consume the trailing
    whitespace, only in the `from_str` method.
    pitdicker committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    baec95f View commit details
    Browse the repository at this point in the history
  6. Allow 't' as a seperator between date and time in `parse_rfc3339_rela…

    …xed`
    
    From the standard:
    > NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this syntax may
    > alternatively be lower case "t" or "z" respectively.
    
    The strict parser accepted 't', now the relaxed parser also does.
    pitdicker committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    893965c View commit details
    Browse the repository at this point in the history
  7. Use parse_rfc3339 directly in DateTime::parse_from_rfc3339

    We want this to use the strict parser directly, so we can switch the `RFC3339`
    item to a relaxed parser.
    pitdicker committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    1032a0c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    70d3062 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    012c3c8 View commit details
    Browse the repository at this point in the history