From 168e4e4b45bc03c9e9df78b41d51a5f130ef30d7 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 29 Jul 2017 22:13:47 -0400 Subject: [PATCH] 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. --- chrome/content/zotero/xpcom/timeline.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/timeline.js b/chrome/content/zotero/xpcom/timeline.js index fdf27afb3..51e733e70 100644 --- 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 = '