From 6f7cb75256e6d75a19979b160305a5b8a00e91d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 21 Jun 2017 20:19:02 +0200 Subject: [PATCH] Fix bad datetime conversion --- lib/cartodb/models/dataview/histogram.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cartodb/models/dataview/histogram.js b/lib/cartodb/models/dataview/histogram.js index b7bb29a4..dbaa002f 100644 --- a/lib/cartodb/models/dataview/histogram.js +++ b/lib/cartodb/models/dataview/histogram.js @@ -155,7 +155,10 @@ var dateHistogramQueryTpl = dot.template([ ' CASE WHEN min_val = max_val', ' THEN 0', ' ELSE GREATEST(1, LEAST(', - ' WIDTH_BUCKET({{=it._column}}::timestamp AT TIME ZONE \'{{=it._timezone}}\', bins_array),', + ' WIDTH_BUCKET(', + ' {{=it._column}}::timestamp WITHOUT TIME ZONE AT TIME ZONE \'{{=it._timezone}}\',', + ' bins_array', + ' ),', ' bins_number', ' )) - 1', ' END AS bin,',