Skip to content

formatDate cannot parse valid value #1396

@liemdo

Description

@liemdo

I get error RangeError: Invalid time value when passing the timestamp to formatDate.

formatDate('2019-08-06T15:16:23.000Z')

However, this works fine:

formatDate(new Date('2019-08-06T15:16:23.000Z'))

Expected behavior

formatDate should be able to parse the timestamp

Current behavior

Get error RangeError: Invalid time value

Step to reproduce for BUG REPORT

Your Environment

Executable Version
npm ls react-intl 3.1.1
npm ls react 16.8.6
npm --version 6.9.0
node --version 12.4.0
OS Version
macOS Mojave 10.14.5
Browser Version
Chrome 75.0.3770.142

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