Skip to content

Commit

Permalink
Passing tests for moment#455
Browse files Browse the repository at this point in the history
  • Loading branch information
timrwood committed Oct 2, 2012
1 parent 0bfa892 commit f285648
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions moment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit f285648

Please sign in to comment.