iamkun / iamkun/dayjs

customParseFormat with JS Date return Invalid format

Open
#2,086 2 comments 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**
Plugin customParseFormat can't work with JS Date.
```
dayjs.extend(customParseFormat);
dayjs(new Date('2022-10-20 15:00:00'), 'DD.MM.YYYY').format('YYYY-MM-DD HH:mm') // Invalid Date
```

**Expected behavior**
```
dayjs(new Date('2022-10-20 15:00:00'), 'DD.MM.YYYY').format('YYYY-MM-DD HH:mm') // 2022-10-20 15:00
```

**Information**
- Day.js Version [v1.11.5]
- OS: any
- Browser: any
- Time zone: any

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.