commit 168e4e4b45bc03c9e9df78b41d51a5f130ef30d7
parent fba412fe4a14276767d22c6b5831f9f567b37af7
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 29 Jul 2017 22:13:47 -0400
Default month/day to 01 in Timeline if missing
This causes any item with just a year to show up at the start of the
year (instead of just not showing up, which I think was the case
before). Unfortunately they can then go out of view, and it's not
possible to scroll to view more, though that could probably be fixed.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/timeline.js b/chrome/content/zotero/xpcom/timeline.js
@@ -34,10 +34,10 @@ Zotero.Timeline = {
var date = item.getField(dateType, true, true);
if (date) {
let sqlDate = (dateType == 'date') ? Zotero.Date.multipartToSQL(date) : date;
- sqlDate = sqlDate.replace("00-00", "01-01");
+ sqlDate = sqlDate.replace("-00-", "-01-").replace(/-00$/, "-01");
let content = '<event start="' + Zotero.Date.sqlToDate(sqlDate) + '" ';
let title = item.getField('title');
- content += 'title=" ' + (title ? escapeXML(title) : '') + '" ';
+ content += 'title="' + (title ? escapeXML(title) : '') + '" ';
content += 'icon="' + item.getImageSrc() + '" ';
content += 'color="black">';
content += item.id;