Better Date Field
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
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!