Skip to content

Commit

Permalink
Fixed Issue with Date
Browse files Browse the repository at this point in the history
  • Loading branch information
silentdot authored Nov 20, 2020
1 parent 2391e9d commit 299b8be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Markdown Item URI.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
function doExport() {
var item;
while(item = Zotero.nextItem()) {
var date = new Date(item.date).getFullYear()
var date = Zotero.Utilities.strToDate(item.date).year;

var year = date && !isNaN(date) ? date + ". " : (typeof item.date == 'undefined'? "" : item.date + ". ");
var library_id = item.libraryID ? item.libraryID : "";
var author_lastname = item.creators[0].lastName ? item.creators[0].lastName + ". " : "";
var title = item.title ? "*" + item.title + "*" : "";
var key = item.key;

Zotero.write(`[${author_lastname}${year}${title}](zotero://select/items/${library_id}_${key})`)
Zotero.write(`[${author_lastname}${year}${title}](zotero://select/items/${library_id}_${key})`);
}
}

0 comments on commit 299b8be

Please sign in to comment.