Closed DiegoPino closed 8 months ago
Solved. New twig extension (needs documentation). edtf_2_iso_date
returns and array of valid ISO dates given a valid EDTF one. If something fails/the passed date is wrong, the return is an empty array
https://github.com/esmero/format_strawberryfield/commit/b028600d003c0ba0294020dfed436fc24fc82810
What?
Ok, let's start by pinging @alliomeria here. The issue is this: currently with the humanizer If I get
19XX-XX-XX
I will get1910s
humanized and I need(1900)
in e.g APA If I get1912?-1X-XX
I will getOctober 1912 (year is uncertain and approximate)
and I need(1912, October)
in APA As you notice the combinations of the humanizer make parsing back into the year/month/day for citation/CSL or even (in my case) manual generation, difficult. Doing this in twig is possible (basically anything is possible) but also too much engineeringWhat I propose is to create a new extension
edtf_2_iso_date
that uses a similar logic as the one found when sending ETDF to Solr. From a given EDFT string we process the lower and upper limits back to valid ISO8601 (without minutes, seconds, etc, formatted to "day" precision and deduplicated). If someone then needs to make those humanized the existing extension can be called against those returned values. That is more flexibleWhat do you think?