As I was thinking about this, thought I’d post it …
We have recently added EDTF to represent dates on the input schema.
Open questions are which features we support, and the status of the date-parts JSON representation. If it stays long-term, we might want to reconcile them as much as possible now.
If not, this could help with documenting regardless.
Feature
EDTF
CSL JSON 1.0
Notes
Seasons
2019-21
“season” property
The JSON could also support this on the month part.
Seasons. Definitely yes. Seasons are, after all, already supported: the numbers are just different (IIRC 13=spring, 14=summer, 15=fall, 16=winter) on date parts. Luckily these don’t overlap, so one can just allow 13/21 = spring, 14/22 = summer, 15/23 = fall and 16/24 = winter, and there is no room for confusion. Processors will almost certainly normalize on input.
Uncertain, approximate, and uncertain+approximate: I’d support. I think this requires an additional test (is-approximate-date): and an additional potential value on the JSON input for that too. I doubt you need a test for is-uncertain-and-approximate: it should be possible to combine tests. But since uncertainty and approximation are different ideas, it makes sense to separate them.
Ranges. Definitely support, since they are already supported. Could you allow this on date-parts by adopting the convention that 0 means open? Even if you could, I wouldn’t: You don’t want to break date-parts, but there’s no particularly good reason to extend them.
Decades and centuries. Part of me says “don’t support”, because it’s going to be a ton of work. You will need locale-terms for centuries and decades, presumably in both long and short versions, and I suspect that the effort is not worth the very limited use. OTOH, one nearly always regrets bodging things like this. I don’t know enough about other languages to know how difficult the locale-specific stuff would be.
Though, it occurs to me now, that only allows the uncertainty or circa to be specified for the date as a whole. EDTF allows more fine-grained encoding; though again, am not certain we need that for this use case?
I think the same issue would apply to season ranges; not clear how we could represent “2017-21/2017-22” unless we encoded the season in month slot, as with EDTF.
I thought that the season was already encoded in the month slot! It does in the test suite anyway, though I think the spec is unclear about it. It encodes to 13, 14, 15, or 16, so [ [16], [2020] ] is Winter 2020. It’s certainly the reasonable thing to do, because you are not likely to have both season and month, and season really means “month as trimester”.
I think it’s reasonable to say that fine-grained control can be left to those who are willing to use EDTF. But it would be a pity if the JSON form wasn’t able to signal approximate, because I’d have thought the “c. 1900” or “1900?” forms are generally useful. I rather doubt very fine-grained control will often be needed, but if it is, the user can drop back to EDTF.
Citeproc-JS is also willing to devote a great deal of effort to parsing all manner of odd dates. That’s very kind of it, but I’d be inclined to say that it is “above and beyond the call of duty”. I’d think the standard should simply be: parse date-parts or EDTF properly, and no guarantees are required about dates in any other form: a processor may be helpful about them, or may simply pass them as text.
PS: I’d prefer “isApproximate”, because I think it’s desirable if variable names make their type explicit, but that’s a detail.
ETA: You might like to investigate whether existing styles use “uncertain-date” to mean “unknown” or “approx”. If they generally render it as “c.”, you might prefer to introduce two new flags, such as isIndeterminate and isApproximate and have isUncertain treated as if it meant isApproximate. That’s not ideal, but it might be kinder, if that’s how it’s currently mostly used.
Part of what we need to settle, though, is what features of EDTF we support, and what we don’t.
Looking more closely at the spec, I think we do want the Level 1 feature “Qualification of a date (complete),” but we do not want the Level 2 extension “Qualification of Individual Component.”
That would keep the two date representations consistent, and simplify implementation.
In that case, probably the sensible path is to follow biblatex, and say we support levels 0 and 1, with the same approach to uncertain dates (though we need more feedback from others on the X feature, which biblatex does support).
Right. And to facilitate conversion between EDTF and date-parts we’d probably best retire the current “global” circa flag, and introduce two new flags (circa, or to make the connection to EDTF explicit: approximate, or approx; and uncertain) for both standalone/start and end date.
How would that work, given the current parts model is an array?
And are we certain that this is valid EDTF Level 1: “2004-02-01?/2005-02-08”? Neither that spec nor the biblatex docs include such an example, though the implicit suggestion is it is.
I played a bit with node and edtf, which shows (per @njbart’s tests) the model has a Date object, and an Interval object, whose “values” property is an array of Date objects.
How do uncertain and approximate play with style coding? Right now, CSL just has one is-uncertain-date="issued" condition; it doesn’t distinguish between uncertain and approximate senses of “circa”.
Are uncertain vs approximate dates rendered differently in styles, or are they just both annotated as “circa”? If there isn’t a rendering difference, then let’s just add uncertain and approximate while also retaining circa in a deprecated state. All three of these would make is-uncertain-date="issued" test true.
Okay, so it would seem that at least these changes are needed in CSL style syntax:
Make a new attribute is-approximate-date that covers existing circa behavior (indicates the date is circa/approximate)
Change the behavior of the existing is-uncertain-date to cover actual uncertainty.
Accompanying this, batch-change all existing styles to use is-approximate-date instead of is-uncertain-date.
As for other changes,
Date ranges
Date range support is currently tricky because circa applies to the date as a whole, which precludes things like this:
ca. 1950–1 January 2012
ca. 1884–ca. 1902
The main uses for is-uncertain-date currently are to add a “circa” term and to surround the date in brackets. It seems rather odd to require that all styles manually specify how to position circa, question mark, etc. Do these really vary that much? I suggest that we add placement of the circa term and the uncertainy question mark to locale files. (A similar change is needed to provide better support for formatting the ad/bc/ce/bce terms for era notation.)
Then, is-uncertain-date and is-approximate-date can still test globally and be true if either part of a date rate is uncertain/approximate. That would permit enclosing the date in square brackets, etc. (which does seem to vary across styles).
(In the data model, we should deprecate the global circa element in favor of specifying uncertain/approximate on each range element. For legacy data, consider a global circa element as applying to both parts of a range.)
Decades/centuries
I don’t see a problem with supporting X notation in years. For general rendering, that won’t create any issue, just pass the Xs through and render them. If we supported these via X notation in years, it would be nice to have accompanying form="text" localizations (i.e., for centuries, translating the date into an ordinal number and add a new term for century, for decades, adding a new term for decade and specifying in the locale how to format “1950s decade”).