Skip to content

Making Tod::TimeOfDay.parse more flexible #70

@fig

Description

@fig

Proposal

Currently, the only separator permitted by the parser is a colon (:)

How do you feel about making the parser more flexible by allowing any non-digit character to be treated as a seperator?

Rationale

I work in the rail transport sector and railway timetables can contain a whole variety of separators, each with their own meaning:

  • 08.00 - Regular passenger train
  • 08+00 - Empty coaching stock
  • 08S00 - Stop for staff pick up / set down only
  • 08RM00 - Train will make a reversing move. (Depart in the same direction it arrived)

I'm sure there are other areas, including user input via html forms, where greater flexibilty might be beneficial.

Allowing any separator will make parsing any data more flexible and simpler.

Problems

The change could possibly break clients that rely on Tod parsability to validate data that must only use a colon as a seperator

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions