这似乎是一个微不足道的问题,但我得到一个奇怪的错误:大纪元转换与D3
"Uncaught TypeError: t.slice is not a function"
试图Unix时间戳传递给我的代码时。
var myDate = new Date(1075611600000);
var format = d3.time.format("%Y").parse; //Trying to return the year.
console.log(format(myDate)); //error noted above
console.log(myDate); //Sun Feb 01 2004 00:00:00 GMT-0500 (EST)
有人看到我正在犯的明显错误吗?提前致谢。我看过this的例子,我不明白我做错了什么。我试图只返回一年。
你到底想实现什么呢? – Bigood