MCPcopy Index your code
hub / github.com/csev/py4e / addFormatToken

Function addFormatToken

code/gmane/Chart.bundle.js:2022–2042  ·  view source on GitHub ↗
(token, padded, ordinal, callback)

Source from the content-addressed store, hash-verified

2020 // ordinal: 'Mo'
2021 // callback: function () { this.month() + 1 }
2022 function addFormatToken (token, padded, ordinal, callback) {
2023 var func = callback;
2024 if (typeof callback === 'string') {
2025 func = function () {
2026 return this[callback]();
2027 };
2028 }
2029 if (token) {
2030 formatTokenFunctions[token] = func;
2031 }
2032 if (padded) {
2033 formatTokenFunctions[padded[0]] = function () {
2034 return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
2035 };
2036 }
2037 if (ordinal) {
2038 formatTokenFunctions[ordinal] = function () {
2039 return this.localeData().ordinal(func.apply(this, arguments), token);
2040 };
2041 }
2042 }
2043
2044 function removeFormattingTokens(input) {
2045 if (input.match(/\[[\s\S]/)) {

Callers 4

Chart.bundle.jsFile · 0.85
offsetFunction · 0.85
addWeekYearFormatTokenFunction · 0.85
meridiemFunction · 0.85

Calls 1

zeroFillFunction · 0.85

Tested by

no test coverage detected