- Add some month/year tests (many of which fail -- refs #1731)
- Always delete empty strToDate part (for proper testing)
This commit is contained in:
parent
7b6e017d38
commit
908b96ccc4
|
@ -2214,9 +2214,10 @@ Zotero.Date = new function(){
|
||||||
// clean up date part
|
// clean up date part
|
||||||
if(date.part) {
|
if(date.part) {
|
||||||
date.part = date.part.replace(/^[^A-Za-z0-9]+/, "").replace(/[^A-Za-z0-9]+$/, "");
|
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;
|
return date;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user