diff --git a/chrome/content/zotero/xpcom/date.js b/chrome/content/zotero/xpcom/date.js index 98a0bded23..ec36d83a72 100644 --- a/chrome/content/zotero/xpcom/date.js +++ b/chrome/content/zotero/xpcom/date.js @@ -263,6 +263,8 @@ Zotero.Date = new function(){ order: '' }; + string = Zotero.Utilities.trimInternal(string.toString()); + // skip empty things if(!string) { return date; @@ -270,21 +272,6 @@ Zotero.Date = new function(){ var parts = []; - // Parse 'yesterday'/'today'/'tomorrow' - var lc = (string + '').toLowerCase(); - if (lc == 'yesterday' || (Zotero.isClient && lc === Zotero.getString('date.yesterday'))) { - string = Zotero.Date.dateToSQL(new Date(Date.now() - 1000*60*60*24)).substr(0, 10); // no 'this' for translator sandbox - } - else if (lc == 'today' || (Zotero.isClient && lc == Zotero.getString('date.today'))) { - string = Zotero.Date.dateToSQL(new Date()).substr(0, 10); - } - else if (lc == 'tomorrow' || (Zotero.isClient && lc == Zotero.getString('date.tomorrow'))) { - string = Zotero.Date.dateToSQL(new Date(Date.now() + 1000*60*60*24)).substr(0, 10); - } - else { - string = string.toString().replace(/^\s+|\s+$/g, "").replace(/\s+/, " "); - } - // first, directly inspect the string var m = _slashRe.exec(string); if(m &&