I'm getting JavaScript error "d.getMonth is not a function" when trying to format a date using d3.time.format
<p>I have a date value <code>2016-02-18</code> and I want to convert it to <code>Feb 18</code>.</p>

<p>I tried the following code, but it returns an error that <code>get.month</code> is  not a function. I have also tried using <code>format.parse()</code>, but that didn't work either.</p>

<h3>My code :</h3>

<pre><code>var dateLast = "2016-02-18";
var date = Date.parse(dateLast.replace(/-/g,"/"));
var format =  d3.time.format("%b-%d");
var dateConvert = format(date);
console.log(dateConvert);
</code></pre>

<h3>The error message :</h3>

<blockquote>
  <p>TypeError: d.getMonth is not a function at d3_time_formats.b
  (d3.js:2517) at format (d3.js:2431)</p>
</blockquote>