Skip to content

[Bug] intl.parseDate fails when microsecond fractions round up to a full second #141

@filipKovachev

Description

@filipKovachev

intl.parseDate fails to parse valid ISO-8601 datetime strings when the fractional seconds are close enough to 1 second to round to 1000ms. The issue appears to be caused by the fractional part .999978 being converted to 999.978ms and rounded to 1000ms, which is outside the valid range and causes the parser to return null. This affects zoned datetime strings with microsecond precision:

https://stackblitz.com/edit/react-yfyvwquq-8vlgamx2?file=app%2Fapp.tsx

Reported in Ticket ID: 1705498

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