js-temporal / proposal-temporal-v2

Future additions to Temporal
MIT License
24 stars 1 forks source link

ISO 8601 string parser #27

Open ptomato opened 1 year ago

ptomato commented 1 year ago

A string parsing API accessible to the programmer (not just through Temporal.___.from()) was considered almost from the very beginning as a potential part of the Temporal (V1) proposal. Ultimately it was decided to be out of scope.

This issue captures the use cases and discussion in case a parser API is proposed in the future.

This feature would probably subsume #22.

Advantages:

These are the use cases that we became aware of during the development of the Temporal V1 proposal:

Previous discussions:

Concerns:

TBD

Prior art:

Many programming languages have an ISO 8601 parser in their standard library, but they all either return the equivalent of a Temporal instance in that language, or an epoch time, or a normalized ISO 8601 string. Some third-party libraries provide a parser functionality:

Constraints / corner cases:

TBD