Remove 'yesterday'/'today'/'tomorrow' parsing from strToDate()
I don't think this ever should've been here. It was added in 2010 but
then added to itembox.xml a couple weeks later in d500b50e2
, since
that's where the conversion should happen.
Closes #1749
This commit is contained in:
parent
24a3a38c51
commit
a549a64de9
1 changed files with 2 additions and 15 deletions
|
@ -263,6 +263,8 @@ Zotero.Date = new function(){
|
||||||
order: ''
|
order: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
|
string = Zotero.Utilities.trimInternal(string.toString());
|
||||||
|
|
||||||
// skip empty things
|
// skip empty things
|
||||||
if(!string) {
|
if(!string) {
|
||||||
return date;
|
return date;
|
||||||
|
@ -270,21 +272,6 @@ Zotero.Date = new function(){
|
||||||
|
|
||||||
var parts = [];
|
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
|
// first, directly inspect the string
|
||||||
var m = _slashRe.exec(string);
|
var m = _slashRe.exec(string);
|
||||||
if(m &&
|
if(m &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue