From 16f4253c6ccf192a0686433b67885f03bbdde5dd Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sat, 21 Jul 2012 18:33:38 -0400 Subject: [PATCH] Handle cases where Zotero.locale is undefined --- chrome/content/zotero/xpcom/date.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/date.js b/chrome/content/zotero/xpcom/date.js index a38b005f6..c6be728e6 100644 --- a/chrome/content/zotero/xpcom/date.js +++ b/chrome/content/zotero/xpcom/date.js @@ -267,7 +267,7 @@ Zotero.Date = new function(){ } else { // local style date (middle or little endian) date.year = m[6]; - var country = Zotero.locale.substr(3); + var country = Zotero.locale ? Zotero.locale.substr(3) : "US"; if(country == "US" || // The United States country == "FM" || // The Federated States of Micronesia country == "PW" || // Palau @@ -668,7 +668,7 @@ Zotero.Date = new function(){ */ function getLocaleDateOrder(){ if (!_localeDateOrder) { - switch (Zotero.locale.substr(-2)) { + switch (Zotero.locale ? Zotero.locale.substr(3) : "US") { // middle-endian case 'US': // The United States case 'BZ': // Belize