From b96630bac86ff88f9f9ad4201416dfe1a8e67c88 Mon Sep 17 00:00:00 2001 From: Gabriel Hedges Date: Wed, 28 Aug 2013 17:22:57 -0700 Subject: [PATCH] Made isPM function compatible with IE8 Quirks Mode and IE7 Standards Mode --- moment.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, -- 2.47.2