MCPcopy Create free account
hub / github.com/csev/py4e / makeFormatFunction

Function makeFormatFunction

code/gmane/Chart.bundle.js:2051–2069  ·  view source on GitHub ↗
(format)

Source from the content-addressed store, hash-verified

2049 }
2050
2051 function makeFormatFunction(format) {
2052 var array = format.match(formattingTokens), i, length;
2053
2054 for (i = 0, length = array.length; i < length; i++) {
2055 if (formatTokenFunctions[array[i]]) {
2056 array[i] = formatTokenFunctions[array[i]];
2057 } else {
2058 array[i] = removeFormattingTokens(array[i]);
2059 }
2060 }
2061
2062 return function (mom) {
2063 var output = '';
2064 for (i = 0; i < length; i++) {
2065 output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
2066 }
2067 return output;
2068 };
2069 }
2070
2071 // format date using native date object
2072 function formatMoment(m, format) {

Callers 1

formatMomentFunction · 0.85

Calls 1

removeFormattingTokensFunction · 0.85

Tested by

no test coverage detected