Skip to content

Reference code allows invalid time strings with fractional seconds but without minutes #3210

@ptomato

Description

@ptomato

The reference polyfill allows this:

> Temporal.PlainTime.from('05:07.123')
Temporal.PlainTime <05:00:07.123>
> Temporal.PlainDateTime.from('2025-04-03T05:07.123')
Temporal.PlainDateTime <2025-04-03T05:00:07.123>

These strings are disallowed (technically they are valid ISO 8601 sec. 5.3.1.4.b, but only by agreement between the interchange parties, which we do not agree to in the case of fractional minutes or hours.)

There is most likely a testing gap here, we should cover that clock time parts such as 05:07.123 are rejected, as well as clock time parts such as 12.5 which the polyfill correctly rejects already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions