]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Made isPM function compatible with IE8 Quirks Mode and IE7 Standards Mode 1033/head
authorGabriel Hedges <GabrielHedges@gmail.com>
Thu, 29 Aug 2013 00:22:57 +0000 (17:22 -0700)
committerGabriel Hedges <GabrielHedges@gmail.com>
Thu, 29 Aug 2013 00:22:57 +0000 (17:22 -0700)
moment.js

index e44164f118ce532ad6c9a20e2c66e28a990ad232..9d69ff4e38417cd5be48bf9fe7918a2438b6ce16 100644 (file)
--- a/moment.js
+++ b/moment.js
         },
 
         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,