MCPcopy Create free account
hub / github.com/breck7/scroll / formatDate

Function formatDate

external/.d3.js:8163–8174  ·  view source on GitHub ↗
(date)

Source from the content-addressed store, hash-verified

8161}
8162
8163function formatDate(date) {
8164 var hours = date.getUTCHours(),
8165 minutes = date.getUTCMinutes(),
8166 seconds = date.getUTCSeconds(),
8167 milliseconds = date.getUTCMilliseconds();
8168 return isNaN(date) ? "Invalid Date"
8169 : formatYear$1(date.getUTCFullYear()) + "-" + pad$1(date.getUTCMonth() + 1, 2) + "-" + pad$1(date.getUTCDate(), 2)
8170 + (milliseconds ? "T" + pad$1(hours, 2) + ":" + pad$1(minutes, 2) + ":" + pad$1(seconds, 2) + "." + pad$1(milliseconds, 3) + "Z"
8171 : seconds ? "T" + pad$1(hours, 2) + ":" + pad$1(minutes, 2) + ":" + pad$1(seconds, 2) + "Z"
8172 : minutes || hours ? "T" + pad$1(hours, 2) + ":" + pad$1(minutes, 2) + "Z"
8173 : "");
8174}
8175
8176function dsvFormat(delimiter) {
8177 var reFormat = new RegExp("[\"" + delimiter + "\n\r]"),

Callers 1

formatValueFunction · 0.85

Calls 2

formatYear$1Function · 0.85
pad$1Function · 0.85

Tested by

no test coverage detected