-
Notifications
You must be signed in to change notification settings - Fork 14
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
Implement parse and equality for intervals with open begin dates. #18
Comments
This is the expected behavior: 'open' may be used when no end date is specified. (You can have an 'unknown' start though) I think with the upcoming ISO 8601-2 profile open starts will be possible (it will probably be one of '/2016', '*/2016' or '../2016' depending on which proposed syntax is adopted). |
Hmm, but we should probably throw an error for |
I see. So |
Yes, I'd say ArgumentError would be appropriate. Though we shouldn't throw it in the constructor but define a setter for from/to instead. The other problem is with the exception when comparing the two intervals, because I this would happen if you use |
Hmm... I hadn't considered that case since I am explicitly avoiding For an open interval, I would expect: Maybe handling unknown/open could be another ticket. There might be some folks from DPLA who would chime in on that thread. |
👍 on |
I agree @no-reply I added Argument Errors if from is anything other than a date or |
Deprecate broken and half-baked adapters
I've run across the issue of not being able to compare intervals that have an open begin dates. In order to test translating date ranges to and from user input fields for start and end, I needed to check that the resulting interval was equal to the expected value for the input. This works well for intervals with a begin date, but does not work when the begin date is left unbounded.
The text was updated successfully, but these errors were encountered: