dayjs('600', 'Hmm').format('h:mm A') return incorrect 12:00 PM instead of 6:00 AM
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
dayjs('600', 'Hmm').format('h:mm A') return incorrect 12:00pm instead of 6:00am
this is after apply customParseFormat
import customParseFormat from 'dayjs/plugin/customParseFormat';
dayjs.extend(customParseFormat);
If use "0600" then the result is correct:
dayjs('0600', 'HHmm').format('h:mm A') give 6:00 AM
**Expected behavior**
dayjs('600', 'Hmm').format('h:mm A') should be display "6:00 AM"
**Information**
- Day.js Version [e.g. v1.0.0] 1.11.13
- OS: [e.g. iOS] Window 11
- Browser [e.g. chrome 62] chrome
- Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)] EST
Contributor guide
Research direction
Start by running the reported dayjs('600', 'Hmm') example after enabling the customParseFormat plugin, then inspect the plugin's parsing path for the Hmm token. Done means the expression formats as 6:00 AM while the existing dayjs('0600', 'HHmm') case remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100