Fix season export in CSL JSON

This commit is contained in:
Aurimas Vinckevicius 2015-08-04 14:19:39 -05:00
parent 0fbae77456
commit bb15336fdb
3 changed files with 5 additions and 4 deletions

View file

@ -330,6 +330,8 @@ Zotero.Date = new function(){
} }
if(date.month) date.month--; // subtract one for JS style if(date.month) date.month--; // subtract one for JS style
else delete date.month;
Zotero.debug("DATE: retrieved with algorithms: "+JSON.stringify(date)); Zotero.debug("DATE: retrieved with algorithms: "+JSON.stringify(date));
parts.push( parts.push(
@ -369,7 +371,7 @@ Zotero.Date = new function(){
} }
// MONTH // MONTH
if(!date.month) { if(date.month === undefined) {
// compile month regular expression // compile month regular expression
var months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', var months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul',
'aug', 'sep', 'oct', 'nov', 'dec']; 'aug', 'sep', 'oct', 'nov', 'dec'];

View file

@ -1611,7 +1611,7 @@ Zotero.Utilities = {
cslItem[variable] = {"date-parts":[dateParts]}; cslItem[variable] = {"date-parts":[dateParts]};
// if no month, use season as month // if no month, use season as month
if(dateObj.part && !dateObj.month) { if(dateObj.part && dateObj.month === undefined) {
cslItem[variable].season = dateObj.part; cslItem[variable].season = dateObj.part;
} }
} else { } else {

View file

@ -1347,8 +1347,7 @@
1, 1,
2 2
] ]
], ]
"season": "2000-01-02"
}, },
"title": "Title", "title": "Title",
"type": "patent" "type": "patent"