Skip to content

readTime and timeParser are too greedy #6

@tel

Description

@tel

When parsing a non-delimited time expression like YYYYMMDD formatTime properly emits it by readTime fails to parse it.

>>> formatTime defaultTimeLocale "%Y%m%d" <$> getCurrentTime
"20130919"
>>> readTime defaultTimeLocale "%Y%m%d" "20130919"
*** Exception: not enough bytes

I believe this is because the underlying attoparsec parser is consuming the entire string while reading a number instead of limiting itself to just the first 4 digits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions