Date.strToDate: Only check for date.* localized strings in client
Zotero.getString() now exists in the connector, but the expected strings aren't defined (or needed), so an error is logged.
This commit is contained in:
parent
d573a5b639
commit
e31d706ee4
1 changed files with 3 additions and 3 deletions
|
@ -296,13 +296,13 @@ Zotero.Date = new function(){
|
|||
|
||||
// Parse 'yesterday'/'today'/'tomorrow'
|
||||
var lc = (string + '').toLowerCase();
|
||||
if (lc == 'yesterday' || (Zotero.getString && lc === Zotero.getString('date.yesterday'))) {
|
||||
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.getString && lc == Zotero.getString('date.today'))) {
|
||||
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.getString && lc == Zotero.getString('date.tomorrow'))) {
|
||||
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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue