Closed RHOOPH closed 11 months ago
Thanks for the issue, are you willing to create a PR with a fix?
I agree that the wikipedia article implies that fractions can be used in Date values, however since Temporal throws a fit (invalid duration
) for that I'll stick to their interpretation and close this issue 🙏
try {
Temporal.Duration.from("PT0.5Y").total({
unit: "second",
relativeTo: relativeDate.toISOString(),
});
} catch (e) {
// RangeError: invalid duration: PT0.5Y
console.error(e);
}```
The Doc says
Fractions are allowed on the smallest unit in the string, e.g. P0.5D or PT1.0001S but not PT0.5M0.1S.
However
parse("P0.5D")
causes errorLink to the example
Fractions in Years, Months and Weeks also causes the same error.