- Add some month/year tests (many of which fail -- refs #1731)

- Always delete empty strToDate part (for proper testing)
This commit is contained in:
Dan Stillman 2010-10-02 05:18:48 +00:00
parent 7b6e017d38
commit 908b96ccc4

View file

@ -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;