]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Updating lang `L LL LLL LLLL LT` replacement to support 5 levels of recursion and...
authorTim Wood <washwithcare@gmail.com>
Mon, 13 Aug 2012 20:31:20 +0000 (13:31 -0700)
committerTim Wood <washwithcare@gmail.com>
Mon, 13 Aug 2012 20:31:20 +0000 (13:31 -0700)
moment.js

index f0554ad1eb646cc24cb3e6871c2e21aff5349b5d..505439f83272a1fdd825b2b07de4eb2c17ccbf06 100644 (file)
--- a/moment.js
+++ b/moment.js
 
     // format date using native date object
     function formatMoment(m, format) {
-        var lang = getLangDefinition(m), i = 2;
+        var lang = getLangDefinition(m), i = 5;
 
         function getValueFromArray(key, index) {
             return lang[key].call ? lang[key](m, format) : lang[key][index];
         }
 
-        while (i--) {
+        while (i-- && localFormattingTokens.test(format)) {
             format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
         }