Skip to content

Commit c993500

Browse files
committed
input: Add EDTF as an option for date representation (#284)
As part of #278, and to harmonize the JSON and YAML representations around a much more concise and expressive date format, this adds a an option to use EDTF; either as a preferred string on any date, or as an "edtf" string property on the more verbose alternative object representation. While EDTF was originally an initiative of the US Library of Congress, ISO adopted it as part of 8601-2 in 2019. Note: The current regular expression pattern only checks for valid characters.
1 parent a67b633 commit c993500

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

schemas/input/csl-data.json

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,14 @@
446446
"title": "Custom key-value pairs.",
447447
"type": "object",
448448
"description": "Used to store additional information that does not have a designated CSL JSON field. The note field can also store additional information, but custom is preferred for storing key-value pairs.",
449-
"examples" : [
450-
{"short_id": "xyz", "other-ids": ["alternative-id"]},
451-
{"metadata-double-checked": true}
449+
"examples": [
450+
{
451+
"short_id": "xyz",
452+
"other-ids": ["alternative-id"]
453+
},
454+
{
455+
"metadata-double-checked": true
456+
}
452457
]
453458
}
454459
},
@@ -492,8 +497,19 @@
492497
}
493498
]
494499
},
500+
"edtf-datatype": {
501+
"title": "EDTF datatype pattern",
502+
"description": "CSL input supports EDTF, validated against this regular expression.",
503+
"type": "string",
504+
"pattern": "^[0-9-%~X?.\/]{4,}$"
505+
},
495506
"date-variable": {
507+
"title": "Date content model.",
508+
"description": "The CSL input model supports two different date representations: an EDTF string (preferred), and a more structured alternative.",
496509
"anyOf": [
510+
{
511+
"$ref": "#/definitions/edtf-datatype"
512+
},
497513
{
498514
"properties": {
499515
"date-parts": {
@@ -520,6 +536,9 @@
520536
},
521537
"raw": {
522538
"type": "string"
539+
},
540+
"edtf": {
541+
"$ref": "#/definitions/edtf-datatype"
523542
}
524543
},
525544
"additionalProperties": false

0 commit comments

Comments
 (0)