iamkun / iamkun/dayjs

🐛 The customParseFormat plugin doesn't handle Dayjs, Date, and number types properly.

Open
#2,744 0 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**
The `dayjs` function itself (except `Dayjs` type in case `dayjs()` call works properly) and `utc` plugin and `customParseFormat`, does not work as expected. It fails to handle certain input types correctly. A demo showcasing the issue can be found [here](https://codesandbox.io/p/sandbox/dayjs-customparseformat-issue-zjxhq6).

**Expected behavior**
The `customParseFormat` plugin should handle `Dayjs`, `Date`, and `number` input types correctly, just as it does for `string` types.

**Information**
- **Day.js Version**: v1.11.13
- **OS**: Fedora 6.10.12-100.fc39.x86_64
- **Browser**: Chrome Version 129.0.6668.89 (Official Build) (64-bit)
- **Time zone**: Berlin (GMT+2)

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction and trace the customParseFormat and utc plugin entry points used by the dayjs function. Check how Dayjs, Date, and number inputs are handled compared with strings. Done means those input types behave correctly under the demonstrated customParseFormat and utc usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.