title: Pass Queryset list to javascript function with date time field
body: <p>With a query set from my django model, I would like to print a LineChart using Google Chart with date time in X values.</p>
  
  <p>The date time in javascript need to be in this format :</p>
  
  <pre><code>new Date(YEAR, MONTH, DAY, HOUR, MINUTE)
  </code></pre>
  
  <p>I need to pass a list like this one to Google Chart:</p>
  
  <pre><code>data.addRows([
      [new Date(2000, 8, 5), 1200],
      [new Date(2001, 8, 5), 1223],
      [new Date(2002, 8, 5), 1240]
  ]
  </code></pre>
  
  <p>In my django views.py file, I am doing this :</p>
  
  <pre><code>def Function(request, page_id):
  
      query_set = MyModel.objects.filter(page__pk=page_id)
  
      list_impressions = query_set.values_list('created_at', 'page_impressions')
      context = {'impressions': list_impressions}
  
      return render(request, 'datacenter/facebook/impressions.html', context)
  </code></pre>
  
  <p>In my django template,</p>
  
  <pre><code>{% for record in impressions %}
      {{ record }}
  {% endfor %}
  </code></pre>
  
  <p>I get : </p>
  
  <pre><code>(datetime.datetime(2017, 2, 1, 8, 17, 49, 732016, tzinfo=&lt;UTC&gt;), 219482)
  (datetime.datetime(2017, 2, 1, 8, 52, 11, 912992, tzinfo=&lt;UTC&gt;), 219482)
  </code></pre>
  
  <p>But I need to pass to javascript :</p>
  
  <pre><code>var data = google.visualization.arrayToDataTable(
      [new Date(2017, 2, 1, 8, 17, 49), 1200],
      [new Date(2017, 2, 1, 8, 52, 11), 1223]
  );
  </code></pre>
  
  <p>Where should I make the link between the representation of date time in Django and Javascript ? Views, template ?</p>
  
  <p>I tried to use many other questions in stack overflow with no success. I also tried to build ugly things as creating a list of strings and then transform it in the template.</p>