Islandora / controlled_access_terms

Drupal module for subject and agents
GNU General Public License v2.0
7 stars 28 forks source link

Revert accepting 3-digit years #107

Closed seth-shaw-asu closed 10 months ago

seth-shaw-asu commented 10 months ago

GitHub Issue: N/A

To quote myself:

I am mistaken, [EDTF] does require four years.

I went back to review the spec and was reminded that EDTF is an extension of ISO 8601, which means that the base rules of that spec still apply. Although EDTF only specifies a required number of year digits for significant digits notation, the base rules for ISO 8601 do require four digits.

So, mea culpa, those three-digit years are invalid.

What does this Pull Request do?

Puts back check for four+ digit years.

What's new?

How should this be tested?

Tests pass. 👍

Interested parties

@Islandora/committers

rosiel commented 10 months ago

It seems very odd to me that a library standard that accepts year 17000000 does not accept years -999 through 999. But I think they do, just with leading zeroes, per ISO 8601?

Interesting (to me) was the Wikipedia page on ISO 8601:

ISO 8601 prescribes, as a minimum, a four-digit year [YYYY] to avoid the year 2000 problem. It therefore represents years from 0000 to 9999, year 0000 being equal to 1 BC and all others AD, similar to astronomical year numbering. However, years before 1583 (the first full year following the introduction of the Gregorian calendar) are not automatically allowed by the standard. Instead, the standard states that "values in the range [0000] through [1582] shall only be used by mutual agreement of the partners in information interchange".[19]

This seems very relevant to cultural heritage institutions.

seth-shaw-asu commented 10 months ago

...I think they do, just with leading zeroes, per ISO 8601?

Precisely.