facebook / facebook/hermes

MM/DD/YYYY format leads to invalid date

Open
#865 22 comments 6 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
11.3k
Forks
859
Avg merge
1h 30m
Merged PRs (30d)
3

Description

## Bug Description

When using dates like `12/12/2022` or `11/30/2000 00:00:00`, I get `Date invalid`.

While I know that this is a non-standard date format, both JSC and V8 support these date formats.

I'm also happy to submit a PR to fix this, so long as the team is okay with it.

> This ticket is a duplicate of #647, which seems to have been closed errantly.

- [x] I have run `gradle clean` and confirmed this bug does not occur with JSC

Hermes version: 0.11.0
React Native version (if any): 0.71.0
OS version (if any):
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64):

## Steps To Reproduce

1. `new Date("12/12/2022")`
2. See `Invalid Date` when logging to `console.log`

code example:

## The Expected Behavior

It should parse as December 12th, 2022.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.