Skip to content

Support for interval-shorthand #1

Description

@7yl4r

This is a feature request for interval shorthand as described by the standard:

For / expressions, if any elements are missing from the end value, they are assumed to be the same as for the start value including the time zone. This feature of the standard allows for concise representations of time intervals. For example, the date of a two-hour meeting including the start and finish times could be simply shown as "2007-12-14T13:30/15:30", where "/15:30" implies "/2007-12-14T15:30" (the same date as the start), or the beginning and end dates of a monthly billing period as "2008-02-15/03-14", where "/03-14" implies "/2008-03-14" (the same year as the start).

Input:

from iso8601utils import parsers
parsers.interval('2016-02-17T01:00/02:01')

Expected:

iso8601utils.interval(2016-02-17T01:00:00.000000Z/2016-02-17T02:01:00.000000Z)

Observed:

parsers.interval(2016-02-17T01:00/02:01)
                                 ^
SyntaxError: invalid syntax

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