From d580a89cd5a6f973f3b4023dfd0170ff6e5aedf5 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Sun, 17 Sep 2017 19:08:20 -0700 Subject: [PATCH] Parse and format times --- BUILD.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD.md b/BUILD.md index dd14bcd..5dc7233 100644 --- a/BUILD.md +++ b/BUILD.md @@ -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