ProfessionalWiki / EDTF

PHP library to parse, represent and work with dates that follow the Extended Date/Time Format specification.
https://wikibase.consulting/wikibase-edtf
GNU General Public License v2.0
10 stars 7 forks source link

Add support for ranges with open start/end date #12

Open JeroenDeDauw opened 3 years ago

JeroenDeDauw commented 3 years ago

While we support ranges with open start or end like ../~2004-06-20, we do not support start or end that has a date and is open at the same time, like ..2004-06-01/~2004-06-20. While the later is not part of the public EDTF spec, it appears as example in a proprietary spec.

JeroenDeDauw commented 3 years ago

From @mzeinstra:

Level 2: Date: Combining advanced Qualification with range element expansion and time intervals.

Example: '..2004-06-01/~2004-06-20 (beginning before or on 1 June 2004 and ending approximately the 20th)

JeroenDeDauw commented 3 years ago

@mzeinstra are we sure that is a valid EDTF value? I'm not seeing any combination of .. (open interval) and dates in https://www.loc.gov/standards/datetime/. It also looks like other implementations do not support this.

mzeinstra commented 3 years ago

I've put it on the mail to Claude and Lucien to answer this questions.

I've not seen the formal EDTF standard that they have been using: https://www.iso.org/standard/70908.html

JeroenDeDauw commented 3 years ago

Now confirmed: this is valid EDTF, even though it is not listed in https://www.loc.gov/standards/datetime/

Our current object model cannot express those dates, so adding support is non-trivial (though also not that much work).

JeroenDeDauw commented 3 years ago

More examples in https://github.com/ProfessionalWiki/EDTF/pull/39/commits/e328f53e774ca60a75ec6a7d2a8506c09ff74862

mzeinstra commented 3 years ago

I am not quite sure I understand why these dates fail in the date representation.

I see that dates with .. seem to proces in the Valid Strings Ln92,96,100 do validate right?

        yield '[..1760-12-03]';
        yield '[..1984]';
        yield '{..1984}';

so why would the following not work?

//      yield '..1984';
//      yield '1984..';
//      yield '1670..1673';
JeroenDeDauw commented 3 years ago

Replied with https://github.com/ProfessionalWiki/EDTF/issues/46