Skip to content

[@internationalized/date] parseDate fail to parse valid ISO 8601 #8883

@llmunizz

Description

@llmunizz

Provide a general summary of the issue here

parseDate(new Date().toISOString())

throws
Uncaught Error: Invalid ISO 8601 date string: <isostring>

It should use a more robust regex.

🤔 Expected Behavior?

To parse the provided valid ISO 8601 string;

😯 Current Behavior

Throws.

💁 Possible Solution

Tweak the regex to accept valid ISO 8601 strings;

🔦 Context

No response

🖥️ Steps to Reproduce

import { parseDate } from "@internationalized/date";
Try to parse a valid ISO 8601 string, eg.:

parseDate(new Date().toISOString())

Version

3.8.2

What browsers are you seeing the problem on?

Microsoft Edge

If other, please specify.

No response

What operating system are you using?

Windows 11

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

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