(format)
| 488 | } |
| 489 | |
| 490 | function makeFormatFunction(format) { |
| 491 | var array = format.match(formattingTokens), |
| 492 | i, |
| 493 | length; |
| 494 | |
| 495 | for (i = 0, length = array.length; i < length; i++) { |
| 496 | if (formatTokenFunctions[array[i]]) { |
| 497 | array[i] = formatTokenFunctions[array[i]]; |
| 498 | } else { |
| 499 | array[i] = removeFormattingTokens(array[i]); |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | return function (mom) { |
| 504 | var output = '', |
| 505 | i; |
| 506 | for (i = 0; i < length; i++) { |
| 507 | output += isFunction(array[i]) |
| 508 | ? array[i].call(mom, format) |
| 509 | : array[i]; |
| 510 | } |
| 511 | return output; |
| 512 | }; |
| 513 | } |
| 514 | |
| 515 | // format date using native date object |
| 516 | function formatMoment(m, format) { |
no test coverage detected