From 936142b1317998c43299a915d3b69e5b3ec812e1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 26 Jan 2010 09:51:53 +0000 Subject: [PATCH] Temporary fix to retain special date handling for filingDate even though it's been unmapped from Date base field --- chrome/content/zotero/bindings/itembox.xml | 7 +++++-- chrome/content/zotero/xpcom/data/item.js | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 6c1d1a1741..46416ecb4d 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -417,7 +417,9 @@ if (fieldIsClickable && !Zotero.Items.isPrimaryField(fieldName) - && Zotero.ItemFields.isFieldOfBase(Zotero.ItemFields.getID(fieldName), 'date') + && (Zotero.ItemFields.isFieldOfBase(Zotero.ItemFields.getID(fieldName), 'date') + // TEMP - filingDate + || fieldName == 'filingDate') // TEMP - NSF && fieldName != 'dateSent') { this.addDateRow(fieldNames[i], this.item.getField(fieldName, true), tabindex); @@ -1269,7 +1271,8 @@ if (fieldID) { // Display the SQL date as a tooltip for date fields - if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date')) { + // TEMP - filingDate + if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date') || fieldName == 'filingDate') { valueElement.setAttribute('tooltiptext', Zotero.Date.multipartToSQL(this.item.getField(fieldName, true))); } diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 6d4f234284..d982ea69e4 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -211,7 +211,8 @@ Zotero.Item.prototype.getField = function(field, unformatted, includeBaseMapped) if (!unformatted) { // Multipart date fields - if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date')) { + // TEMP - filingDate + if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date') || field == 'filingDate') { value = Zotero.Date.multipartToStr(value); } } @@ -753,7 +754,8 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) { if (!loadIn) { // Save date field as multipart date - if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date') && + // TEMP - filingDate + if ((Zotero.ItemFields.isFieldOfBase(fieldID, 'date') || field == 'filingDate') && !Zotero.Date.isMultipart(value)) { value = Zotero.Date.strToMultipart(value); }