-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fractional #19
Comments
Hi @dimovpetar, Thanks for bringing this to my attention. This is indeed a mistake on my part, this test-case should not pass. I've given it some thought as how to fix this and the most feasible option I see is to add a configuration option where you can define if you want to be able to handle this in a strict manner or not. The main reason is that this lib is used quite a bit and I want to avoid introducing breakage in downstream packages by introducing a new runtime exception. Practically I'd like to propose the following:
Would you be willing to create a PR for the first step? |
Hello @MelleB , unfortunately I don't have the time to contribute :) |
@dimovpetar This issue was fixed in #22 . Feel free to open a new issue if you run into any issues! Thanks! |
According to Wikipedia, only the smallest unit can be a decimal fraction:
Quote from the document that Wikipedia refers to:
tinyduration lib allows multiple components to have decimal fractions at the same time. I would expect that values like "P0.5YT0.5M" and "P0.5YT5M" are not allowed
https://github.com/MelleB/tinyduration/blob/9d5e55f085326ec7fb5a67188855cdab0477114b/src/index.test.ts#LL16C26-L16C26
The text was updated successfully, but these errors were encountered: