Parse and format times

master
Matt Huntington 9 years ago
parent 1682c34ebd
commit d580a89cd5

@ -231,6 +231,7 @@ console.log(formatTime(new Date()));
Let's use this when calculating `cx` attributes for our circles:
```javascript
var parseTime = d3.timeParse("%B%e, %Y at %-I:%M%p");
d3.selectAll('circle')
.attr('cx', function(datum, index){
return xScale(parseTime(datum.date)); //use parseTime to convert the date string property on the datum object to a Date object

Loading…
Cancel
Save