MCPcopy Create free account
hub / github.com/idank/explainshell / format

Function format

explainshell/web/static/js/d3.v3.js:7979–7992  ·  view source on GitHub ↗
(date)

Source from the content-addressed store, hash-verified

7977 d3.time.format = function(template) {
7978 var n = template.length;
7979 function format(date) {
7980 var string = [], i = -1, j = 0, c, p, f;
7981 while (++i < n) {
7982 if (template.charCodeAt(i) === 37) {
7983 string.push(template.substring(j, i));
7984 if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i);
7985 if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p);
7986 string.push(c);
7987 j = i + 1;
7988 }
7989 }
7990 string.push(template.substring(j, i));
7991 return string.join("");
7992 }
7993 format.parse = function(string) {
7994 var d = {
7995 y: 1900,

Callers 1

d3_scale_logFunction · 0.85

Calls 1

fFunction · 0.70

Tested by

no test coverage detected