From 908b96ccc460a05a1fa7f28ce9814827c6cca2a2 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 2 Oct 2010 05:18:48 +0000 Subject: [PATCH] - Add some month/year tests (many of which fail -- refs #1731) - Always delete empty strToDate part (for proper testing) --- chrome/content/zotero/xpcom/zotero.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index d4d634a0ac..438a857e55 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -2214,9 +2214,10 @@ Zotero.Date = new function(){ // clean up date part if(date.part) { date.part = date.part.replace(/^[^A-Za-z0-9]+/, "").replace(/[^A-Za-z0-9]+$/, ""); - if(!date.part.length) { - date.part = undefined; - } + } + + if(date.part === "" || date.part == undefined) { + delete date.part; } return date;