Date format mangling on import of DOI
It seems like sometimes when importing citations from DOI, the date format is converted to legacy/non-optimal forms: e.g. importing this DOI: 10.1007/s10948-013-2148-x
leads to a date in Zotero (string): "8/2013",
The ISO format for dates is used in many cases and seems like it would always be preferred (in this case, it would be "2013-08")
The XML data for this DOI has an unambiguous format with labeled year and month, so the conversion to legacy format string seems to be happening inside the Zotero client. (see http://api.crossref.org/works/10.1007/s10948-013-2148-x/transform/application/vnd.crossref.unixref+xml )
leads to a date in Zotero (string): "8/2013",
The ISO format for dates is used in many cases and seems like it would always be preferred (in this case, it would be "2013-08")
The XML data for this DOI has an unambiguous format with labeled year and month, so the conversion to legacy format string seems to be happening inside the Zotero client. (see http://api.crossref.org/works/10.1007/s10948-013-2148-x/transform/application/vnd.crossref.unixref+xml )
https://github.com/zotero/translators/blob/master/CrossRef.js#L298
but it's not really a mangling: Zotero stores dates in both ISO and string format (with string displayed and ISO visible on hover-over) and it's not clear to me that month/year is actually any worse than ISO for human readability -- if anything it's probably more widely used, which I assume this was originally coded.
I tried to figure out why the Zotero API is returning a raw date string for "issued" fields with format=csljson, and I am stumped. The code at https://github.com/zotero/zotero/blob/master/chrome/content/zotero/xpcom/utilities.js#L1655 suggests that a "date-parts" object will be returned, but I am getting a raw string instead. (see https://api.zotero.org/users/4484687/collections/G3J73ZTD/items?format=csljson )
@dstillman any thought on why the server/API does this differently (wrongly, I'd say)?
... there's a continue; statement in a weird place, that seems to always block the rest of the foreach loop from running. Is it supposed to be inside the block?