From: Gabriel Hedges Date: Thu, 29 Aug 2013 00:22:57 +0000 (-0700) Subject: Made isPM function compatible with IE8 Quirks Mode and IE7 Standards Mode X-Git-Tag: 2.2.0~9^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F1033%2Fhead;p=thirdparty%2Fmoment.git Made isPM function compatible with IE8 Quirks Mode and IE7 Standards Mode --- diff --git a/moment.js b/moment.js index e44164f11..9d69ff4e3 100644 --- a/moment.js +++ b/moment.js @@ -471,7 +471,9 @@ }, isPM : function (input) { - return ((input + '').toLowerCase()[0] === 'p'); + //IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays + //Using charAt should be more compatible. + return ((input + '').toLowerCase().charAt(0) === 'p'); }, _meridiemParse : /[ap]\.?m?\.?/i,