Fix CrossRef translator to not pull XML into Date field if more than one date -- just use the first

This commit is contained in:
Dan Stillman 2009-09-20 04:55:26 +00:00
parent 9a39145a48
commit 110d6bac70

View file

@ -8,7 +8,7 @@
"maxVersion":"", "maxVersion":"",
"priority":90, "priority":90,
"inRepository":true, "inRepository":true,
"lastUpdated":"2009-09-20 02:00:00" "lastUpdated":"2009-09-20 04:55:00"
} }
function detectSearch(item) { function detectSearch(item) {
@ -119,9 +119,11 @@ function processCrossRef(xmlOutput) {
item.creators.push(creator); item.creators.push(creator);
} }
item.date = refXML.publication_date.year.toString(); if(refXML.publication_date.length()) {
if(refXML.publication_date.month.length()) { item.date = refXML.publication_date[0].year.toString();
item.date = refXML.publication_date.month.toString()+"/"+item.date; if(refXML.publication_date[0].month.length()) {
item.date = refXML.publication_date[0].month.toString()+"/"+item.date;
}
} }
if(refXML.pages.length()) { if(refXML.pages.length()) {