From 7fed34fa30754ed6157159f572d3c24b1084b963 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 18 Feb 2018 15:24:28 -0500 Subject: [PATCH] Hide Accessed row in attachment box when provided If, say, a link without an access date is created via an import --- chrome/content/zotero/bindings/attachmentbox.xml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/bindings/attachmentbox.xml b/chrome/content/zotero/bindings/attachmentbox.xml index 58b3e3969..a58ca153b 100644 --- a/chrome/content/zotero/bindings/attachmentbox.xml +++ b/chrome/content/zotero/bindings/attachmentbox.xml @@ -260,10 +260,17 @@ if (this.displayAccessed) { this._id("accessed-label").value = Zotero.getString('itemFields.accessDate') + Zotero.getString('punctuation.colon'); - this._id("accessed").value = Zotero.Date.sqlToDate( - this.item.getField('accessDate'), true - ).toLocaleString(); - accessed.hidden = false; + let val = this.item.getField('accessDate'); + if (val) { + val = Zotero.Date.sqlToDate(val, true); + } + if (val) { + this._id("accessed").value = val.toLocaleString(); + accessed.hidden = false; + } + else { + accessed.hidden = true; + } } else { accessed.hidden = true;