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

Function d3_time_parse

explainshell/web/static/js/d3.v3.js:8015–8028  ·  view source on GitHub ↗
(date, template, string, j)

Source from the content-addressed store, hash-verified

8013 return format;
8014 };
8015 function d3_time_parse(date, template, string, j) {
8016 var c, p, i = 0, n = template.length, m = string.length;
8017 while (i < n) {
8018 if (j >= m) return -1;
8019 c = template.charCodeAt(i++);
8020 if (c === 37) {
8021 p = d3_time_parsers[template.charAt(i++)];
8022 if (!p || (j = p(date, string, j)) < 0) return -1;
8023 } else if (c != string.charCodeAt(j++)) {
8024 return -1;
8025 }
8026 }
8027 return j;
8028 }
8029 function d3_time_formatRe(names) {
8030 return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i");
8031 }

Callers 4

d3.v3.jsFile · 0.85
d3_time_parseLocaleFullFunction · 0.85
d3_time_parseLocaleDateFunction · 0.85
d3_time_parseLocaleTimeFunction · 0.85

Calls 1

pFunction · 0.70

Tested by

no test coverage detected