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

Function d3_time_scaleUTCSetYear

explainshell/web/static/js/d3.v3.js:8396–8400  ·  view source on GitHub ↗
(y)

Source from the content-addressed store, hash-verified

8394 } ] ];
8395 var d3_time_scaleUTCFormat = d3_time_scaleFormat(d3_time_scaleUTCFormats);
8396 function d3_time_scaleUTCSetYear(y) {
8397 var d = new Date(Date.UTC(y, 0, 1));
8398 d.setUTCFullYear(y);
8399 return d;
8400 }
8401 function d3_time_scaleUTCGetYear(d) {
8402 var y = d.getUTCFullYear(), d0 = d3_time_scaleUTCSetYear(y), d1 = d3_time_scaleUTCSetYear(y + 1);
8403 return y + (d - d0) / (d1 - d0);

Callers 1

d3_time_scaleUTCGetYearFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected