Duration from ISO String with milliseconds doesn't set milliseconds
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Creating a duration from an ISO String doesn't set the milliseconds in the duration object.
`dayjs.duration("P4DT12H30M17.899S")`
returns
`{ years: 0, months: 0, weeks: 0, days: 4, hours: 12, minutes: 30, seconds: 17.899 }`
**Expected behavior**
The milliseconds will be set
`{ years: 0, months: 0, weeks: 0, days: 4, hours: 12, minutes: 30, seconds: 17, milliseconds: 899 }`
**Information**
- Day.js Version v1.10.7
Contributor guide
Research direction
Start by running the reported dayjs.duration("P4DT12H30M17.899S") expression and trace the duration parsing entry point. Confirm that the resulting object separates seconds from milliseconds as shown in the expected behavior, then verify the same case with the project's relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100