Skip to content

PlainTime.from() parsing but discarding offsets and time zones is surprising #3293

@eemeli

Description

@eemeli

With the current spec, this happens:

Temporal.PlainTime.from('12:34').toString()    // '12:34:00'
Temporal.PlainTime.from('12:34+19').toString() // '12:34:00'
Temporal.PlainTime.from('12:34+99').toString() // RangeError

As far as I can tell, only the PlainTime endpoints support parsing a string without a date component, and the syntax for that includes AnnotatedTime, which includes offsets and annotations that must be correct if they're included. However, those offsets and annotations are ignored in the returned PlainTime.

This is kinda weird. Would it not make sense to require the string value not to include any offset or annotations? I've looked through the history of proposal, but I was not able to find any rationalisation for the support of time+timezone strings for PlainTime.

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