Add full-fledged support for ISO 8601-1 duration

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor
    • None
    • Affects Version/s: None
    • Component/s: Vocabularies
    • None
    • Environment:

      Proposed

    • Hide

      Similar to Core.LocalDateTime add a new type definition based on Edm.String.

      Core.YearMonthDayDuration is a duration in years, months, and days that can be used to describe regularly recurring calendar events. Services MAY support arithmetic operations on Core.YearMonthDayDuration values and with Edm.Date values and MAY describe this via the term Capabilities.YearMonthDayDurationSupport.

      Show
      Similar to Core.LocalDateTime add a new type definition based on Edm.String . Core.YearMonthDayDuration is a duration in years, months, and days that can be used to describe regularly recurring calendar events. Services MAY support arithmetic operations on Core.YearMonthDayDuration values and with Edm.Date values and MAY describe this via the term Capabilities.YearMonthDayDurationSupport .

      Next version of OData [protocol |https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html] should support full-fledged duration for Edm.Duration .

      The [ABNF|https://docs.oasis-open.org/odata/odata/v4.01/os/abnf/odata-abnf-construction-rules.txt] today states duration value is

         [ SIGN ] "P" [ 1*DIGIT "D" ] [ "T" [ 1*DIGIT "H" ] [ 1*DIGIT "M" ] [ 1*DIGIT [ "." 1*DIGIT ] "S" ] ]
      i.e. no years or month as defined by W3C's XML dayTimeDuration.

      In contrast, ISO 8601-1 2019  5.5.2.2 allows to specify Years and Months.

      There are well understood libraries that do support the notion of ISO 8601-1, for example Joda's Period class https://www.joda.org/joda-time/key_period.html

      To notion of weeks or month as a duration makes it possible to model calendar recurrence patterns in a less custom way.

            Assignee:
            Unassigned
            Reporter:
            chrispre
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: