customParseFormat throws wrong time
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
When use dayjs.extend(require("dayjs/plugin/customParseFormat")) it gives the wrong time. I guess this is something to do with format.
Seems like it's happening from dayjs(this._value, "HH:mm").
dayjs(this._value, "HH:mm") --> throw wrong time
dayjs(this._value).format('HH:mm') --> throw right time

Without using customParseFormat plugin(Expected behavior):


With using customParseFormat plugin:


**Information**
- Day.js Version - 1.10.7
- OS: MacOS
- Browser: Chrome Version 96.0.4664.93
- Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]
Contributor guide
Research direction
Start by reproducing the reported difference between dayjs(this._value, "HH:mm") with customParseFormat and dayjs(this._value).format('HH:mm'), using the stated Day.js version and timezone details. Trace the customParseFormat plugin entry point and compare its handling of the HH:mm input with the expected time; done means the reported parsing case produces the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100