Commit ef69d692 by Torkel Ödegaard

Time is now sent in utc when time correction is set to utc #143

parent a54f05e2
......@@ -7,5 +7,6 @@ define([
'./datasourceSrv',
'./keyboardManager',
'./annotationsSrv',
'./graphite/graphiteDatasource',
],
function () {});
\ No newline at end of file
define([
'angular',
'underscore',
'config',
'./graphite/graphiteDatasource'
'config'
],
function (angular, _, config, GraphiteDatasource) {
function (angular, _, config) {
'use strict';
var module = angular.module('kibana.services');
module.service('datasourceSrv', function($q, filterSrv, $http) {
module.service('datasourceSrv', function($q, filterSrv, $http, GraphiteDatasource) {
var defaultDatasource = _.findWhere(_.values(config.datasources), { default: true } );
this.default = new GraphiteDatasource(defaultDatasource, $q, filterSrv, $http);
......
......@@ -9,6 +9,10 @@ define([
function (angular, _, $, config, kbn, moment) {
'use strict';
var module = angular.module('kibana.services');
module.factory('GraphiteDatasource', function(dashboard, $q, filterSrv, $http) {
function GraphiteDatasource(datasource, $q, filterSrv, $http) {
this.url = datasource.url;
this.type = 'graphite';
......@@ -80,7 +84,11 @@ function (angular, _, $, config, kbn, moment) {
date = kbn.parseDate(date);
}
date = moment.utc(date).local();
date = moment.utc(date);
if (dashboard.current.timezone === 'browser') {
date = date.local();
}
if (config.timezoneOffset) {
date = date.zone(config.timezoneOffset);
......@@ -163,4 +171,6 @@ function (angular, _, $, config, kbn, moment) {
return GraphiteDatasource;
});
});
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -156,13 +156,6 @@
}
}
.histogram-legend-dot {
display:inline-block;
height:10px;
width:10px;
border-radius:5px;
}
.histogram-legend-item {
display:inline-block;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment