commit 908b96ccc460a05a1fa7f28ce9814827c6cca2a2
parent 7b6e017d38258678f1c08a3a3909890042fa0123
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 2 Oct 2010 05:18:48 +0000
- Add some month/year tests (many of which fail -- refs #1731)
- Always delete empty strToDate part (for proper testing)
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git 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;