Do not apply timezone for minute an hour aggregations
This commit is contained in:
@@ -403,14 +403,14 @@ Histogram.prototype._buildDateHistogramQuery = function (psql, override, callbac
|
||||
_aggregation: _aggregation,
|
||||
_start: getBinStart(override),
|
||||
_end: getBinEnd(override),
|
||||
_timezone: getTimezone(_timezone)
|
||||
_timezone: getTimezone(_timezone, _aggregation)
|
||||
});
|
||||
} else {
|
||||
dateBasicsQuery = dateBasicsQueryTpl({
|
||||
_query: _query,
|
||||
_column: _column,
|
||||
_aggregation: _aggregation,
|
||||
_timezone: getTimezone(_timezone)
|
||||
_timezone: getTimezone(_timezone, _aggregation)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ Histogram.prototype._buildDateHistogramQuery = function (psql, override, callbac
|
||||
_query: _query,
|
||||
_column: _column,
|
||||
_aggregation: _aggregation,
|
||||
_timezone: getTimezone(_timezone)
|
||||
_timezone: getTimezone(_timezone, _aggregation)
|
||||
});
|
||||
|
||||
var histogramSql = [
|
||||
@@ -551,10 +551,15 @@ function getWidth(override) {
|
||||
return width;
|
||||
}
|
||||
|
||||
function getTimezone(timezone) {
|
||||
function getTimezone(timezone, aggregation) {
|
||||
if (!timezone) {
|
||||
return '0';
|
||||
}
|
||||
|
||||
if (aggregation === 'hour' || aggregation === 'minute') {
|
||||
return '0';
|
||||
}
|
||||
|
||||
var timezoneInHours = Math.ceil(timezone / 3600);
|
||||
return '' + timezoneInHours;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user