Allow EDTF date to refine basic date with time #220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a
start_date
orend_date
has been qualified to the fullest extent possible (down to the day), treat it as a daylong range in EDTF when comparing it to thestart_date:edtf
orend_date:edtf
tag, and compare it both ways to see if there’s any overlap.Originally, I wanted to just append
TXX:XX
to the basic date, but either EDTF.js or the EDTF specification apparently doesn’t allow unspecified digits (X
) within time specifiers. It also wasn’t practical to ignore the time when parsing the EDTF date, because the EDTF date can contain a whole range or set of dates with time precision, not just one. Fortunately, at least EDTF.js seems to recognize 24:00:00 as a synonym for midnight that does not roll over into the following day, per ISO 8601-1:2019/Amd 1:2022.Fixes OpenHistoricalMap/issues#764.