iamkun / iamkun/dayjs

dayjs(1).format('DD/MM/YYYY') returns "31/12/1969" instead of "invalid date"

Open
#2,234 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When pass in an invalid data type into dayjs() function with format 'DD/MM/YYYY', it returns a valid date instead of error message.

**Expected behavior**
should return "invalid date" or an exception

**Information**
- Day.js Version [v1.11.6]
- OS: [ubuntu22.04]
- Browser [N/A]
- Time zone: [GMT-07:00 DST (Pacific Daylight Time)]

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.