-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
feat: Validate ISO timestamps with offsets #496
feat: Validate ISO timestamps with offsets #496
Conversation
Thank you for creating this PR. Since I am currently busy rewriting the library based on #463, it may take some time before I release the next version. So I don't recommend to wait and use the |
Sure, no problem! 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this released.
Would you like me to port this changes as part of #502? This would technically be a breaking change, as inputs that would previously throw an error may now pass, so bundling it with other breaking changes might be appropriate. |
Feel free to contribute to #502, but don't go crazy, because I don't want to spend too much time on new features. I want to get the next version out as soon as possible. Until v1, breaking changes are ok. |
Thank you! Merged in #530. |
I've added a bunch of tests with both valid and invalid timestamps and updated the JSDoc to list all the allowed formats.
The regex is relatively permissive as it allows for any number in the offset. If something stricter is required, I can work on it, but I'm afraid it would explode in complexity. For example, a
00:00
offset is valid only if preceded by a+
and not by-
; the maximum offset should be ±12:00, etc.Closes #495.