title: Chart.JS format date in label
body: <p>How do you format the date in a datapoint's label in Chart.JS?</p>
  
  <p>I've tried this:</p>
  
  <pre><code>this.chart = new Chart(ctx,
    {
      data: {
        labels: timestamps 
                  .map(t =&gt; t.toLocaleString([], { month: '2-digit', day: '2-digit', year: '2-digit', hour: '2-digit', minute: '2-digit' })),
        datasets: [
          {
            data: measurements
          }, 
          //etc...
  ]}});
  </code></pre>
  
  <p>It works, but I get a Moment.JS warning message:</p>
  
  <blockquote>
    <p>Deprecation warning: value provided is not in a recognized RFC2822 or ISO format... Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release.</p>
  </blockquote>
  
  <p>Is there a proper way to format dates for data labels in Chart.JS since the method I am using is apparently discouraged?</p>
  
  <p><strong>With <code>labels: timestamps</code></strong></p>
  
  <p><a href="https://i.stack.imgur.com/vAxHO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vAxHO.png" alt="chart showing default date format"></a></p>
  
  <p><strong>With <code>labels: timestamps.map(t =&gt; t.toLocaleString(...)</code></strong></p>
  
  <p><a href="https://i.stack.imgur.com/mFiWz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mFiWz.png" alt="chart showing localeString format"></a></p>