You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Valid ISO 8601 durations such as PT36H can not be parsed using parseDuration from @internationalized/date because 36 falls outside of the internal range constraint.
This current behavior makes it difficult to use parseDuration when you are working with time units only.
I can't tell exactly how the standard treats the issue, but it does seem that there is no general conversion between units. This makes sense to me, because P1DT12H could represent a longer, shorter or equivalent length of time to PT36H depending on the start date time (due to daylight savings). I believe most other ISO 8601 duration implementations preserve the distinction between P1DT12H and PT36H.
I've created a PR since it seems to be unresolved. #7064
This is my first contribution to an open-source project, so please let me know if there's anything I've missed.
Provide a general summary of the issue here
Valid ISO 8601 durations such as
PT36H
can not be parsed usingparseDuration
from@internationalized/date
because 36 falls outside of the internal range constraint.🤔 Expected Behavior?
😯 Current Behavior
💁 Possible Solution
These limits could be removed:
react-spectrum/packages/@internationalized/date/src/string.ts
Line 254 in f600fdf
🔦 Context
This current behavior makes it difficult to use
parseDuration
when you are working with time units only.I can't tell exactly how the standard treats the issue, but it does seem that there is no general conversion between units. This makes sense to me, because
P1DT12H
could represent a longer, shorter or equivalent length of time toPT36H
depending on the start date time (due to daylight savings). I believe most other ISO 8601 duration implementations preserve the distinction betweenP1DT12H
andPT36H
.🖥️ Steps to Reproduce
Version
3.32.0
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
If other, please specify.
No response
What operating system are you using?
Linux
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: