From: Tim Wood Date: Tue, 2 Oct 2012 17:13:32 +0000 (-0700) Subject: Passing tests for #455 X-Git-Tag: 1.7.2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2856481dafaaea0635026eda869d24e79e1674f;p=thirdparty%2Fmoment.git Passing tests for #455 --- diff --git a/moment.js b/moment.js index 7cf48e9b4..a9bb5283e 100644 --- a/moment.js +++ b/moment.js @@ -425,11 +425,6 @@ ************************************/ - // helper for recursing long date formatting tokens - function replaceLongDateFormatTokens(input) { - return getLangDefinition().longDateFormat[input] || input; - } - function removeFormattingTokens(input) { if (input.match(/\[.*\]/)) { return input.replace(/^\[|\]$/g, ""); @@ -461,6 +456,10 @@ function formatMoment(m, format) { var i = 5; + function replaceLongDateFormatTokens(input) { + return m.lang().longDateFormat[input] || input; + } + while (i-- && localFormattingTokens.test(format)) { format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); }