But on re-reading the thread, it looks like date ranges are not yet being handled on the Zotero side, so this is more than a matter of simply flipping a switch -- the date parsing code in Zotero needs to be updated to handle ranges (and some or all of the other types of dates discussed above).
With the core devs chronically overloaded, perhaps an enterprising JavaScript hacker could put together a prototype parser that handles some or all of the suggestions above, to test out and put through its paces?
Solving this one will require simultaneous agreement on exactly what a date can contain and how it should be represented among CSL, the citeproc-js and citeproc-hs processors, Zotero (and other consumers of CSL), as well as the community of style authors. Bruce (CSL creator and project lead) has recently been pushing for adoption of EDTF, which is a starting point. Exactly what parts of that standard are needed for citations is still to be determined, and I guess that's the next step. You can find the discussion here.
In case someone else has the same problem with date ranges, a simple workaround: just insert an underscore, or one or more letters, or various combinations, to fool the parser: 1992_94, 1992to94, 1992_&_1994, etc. Then find & replace-all in your output document. Simple enough to keep me using Zotero until date ranges are supported as such.
I haven't read all the discussion here, but just to say that until I found this forum I was really confused by the data field, and the y-m-d text.
Re. Dan Stillman's comment on pg 1: "The y-m-d just indicates the values that it parses, not the order. We could adjust that, but it's working as intended."
It would be better if it showed you that it recognised the order, or auto-corrected it to the standard format. I realise now that hovering over shows you it recognises it, but took me a while to find.
Also I would be happy to see some updated info on date ranges. I have a case when I need to output range 1983-1984 and have tried several possibilities (including quotes around dates), but in all cases I get only the first date. Using Zotero 2.1rc2.
FWIW, the EDTF effort is making good progress, and just came out with a new draft. It includes support for ranges, and a lot of other stuff useful for us.
I would like to second the JTownend' suggestion for Zotero to correct (or perhaps a better expression would be to transform) date entries visually. It is really confusing and unpractical to have so many different formats of the same date (month name, dd YYYY; dd.mm.YYYY; dd. month name YYYY; YYYY-mm-dd).
There could also be an option similar to altering title case: by right clicking one would choose a desired format. Perhaps that would be the best solution, as it would also allow for resolving the cases such as the one with date ranges mentioned above, or when year is combined with season or month name only.
What's the state of the art in handling uncertain dates? Frank said in this topic that "The ability to handle "circa" dates has already been implemented in the CSL processor" but afaik it's not possible from zotero. What's the "best practice" at the moment? (e.g. certain dates: (2012), uncertain dates: [2012?].)
Any movement on this? I have a number of archival documents where the date is uncertain, and so I'd like Zotero to just output "1940?", but it always strips out the question mark. Is there a way to force Zotero to just print the plain text, and not interpret it? It would seem like a toggle for "do not parse date" would be a relatively minor change, and one that would make a big difference for many Zotero users.
A workaround to the automatic parsing of dates is possible by using a custom exporter. For example, I adapted the default bibtex exporter to suit my needs.
Specifically, I added a if-else statement that checks if the "Rights" field contains the string "npd" (without quotes, meaning: no parse date). If so, the date field is written to the file as is (i.e., wiothout parsing).
The code looks like the following (note that I also added a statement to not write the month if object is a journal article):
if(item.date) { if (item.rights== "npd") { writeField("year", item.date); } else { var date = Zotero.Utilities.strToDate(item.date); // need to use non-localized abbreviation if(typeof date.month == "number" && item.itemType != "journalArticle") { writeField("month", months[date.month], true); } if(date.year) { writeField("year", date.year); } else { writeField("year", item.date); } } }
The full custom bibtex exporter (for use with biber for biblatex-apa) is available here: http://pastebin.com/D8jdveEE
With the core devs chronically overloaded, perhaps an enterprising JavaScript hacker could put together a prototype parser that handles some or all of the suggestions above, to test out and put through its paces?
Re. Dan Stillman's comment on pg 1: "The y-m-d just indicates the values that it parses, not the order. We could adjust that, but it's working as intended."
It would be better if it showed you that it recognised the order, or auto-corrected it to the standard format. I realise now that hovering over shows you it recognises it, but took me a while to find.
But, otherwise, loving Zotero, thanks!
http://www.loc.gov/standards/datetime/spec.html
There could also be an option similar to altering title case: by right clicking one would choose a desired format. Perhaps that would be the best solution, as it would also allow for resolving the cases such as the one with date ranges mentioned above, or when year is combined with season or month name only.
JR
I use MHRA author-date (3rd edition), Zotero Word for Windows Integration 3.1.13, and 4.0.12 version of Zotero for Firefox.
Specifically, I added a if-else statement that checks if the "Rights" field contains the string "npd" (without quotes, meaning: no parse date). If so, the date field is written to the file as is (i.e., wiothout parsing).
The code looks like the following (note that I also added a statement to not write the month if object is a journal article):
if(item.date) {
if (item.rights== "npd") {
writeField("year", item.date);
} else {
var date = Zotero.Utilities.strToDate(item.date);
// need to use non-localized abbreviation
if(typeof date.month == "number" && item.itemType != "journalArticle") {
writeField("month", months[date.month], true);
}
if(date.year) {
writeField("year", date.year);
}
else {
writeField("year", item.date);
}
}
}
The full custom bibtex exporter (for use with biber for biblatex-apa) is available here: http://pastebin.com/D8jdveEE
EDIT: Changed extra field to rights field!