diff --git a/package.json b/package.json index a2bc50da71143..17f25208c1dad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "timelion", - "version": "0.1.174", + "version": "0.1.175", "dependencies": { "body-parser": "^1.12.0", "boom": "^2.8.0", diff --git a/public/app.js b/public/app.js index 026aaacb60914..3758c69fe6aa8 100644 --- a/public/app.js +++ b/public/app.js @@ -1,5 +1,4 @@ var _ = require('lodash'); - var logoUrl = require('./logo.png'); require('angularSortableView'); @@ -45,12 +44,13 @@ require('ui/routes') }); app.controller('timelion', function ( - $scope, $http, timefilter, AppState, courier, $route, $routeParams, kbnUrl, Notifier, config, $timeout) { + $scope, $http, timefilter, AppState, courier, $route, $routeParams, kbnUrl, Notifier, config, $timeout, Private) { timefilter.enabled = true; var notify = new Notifier({ location: 'Timelion' }); + var timezone = Private(require('plugins/timelion/services/timezone'))(); var defaultExpression = '.es(*)'; var savedSheet = $route.current.locals.savedSheet; var blankSheet = [defaultExpression]; @@ -152,7 +152,8 @@ app.controller('timelion', function ( $http.post('/timelion/sheet', { sheet: $scope.state.sheet, time: _.extend(timefilter.time, { - interval: getInterval($scope.state) + interval: getInterval($scope.state), + timezone: timezone }), }) // data, status, headers, config diff --git a/public/directives/chart_directive.js b/public/directives/chart_directive.js index c9d790bc28053..f39a1ca9411ff 100644 --- a/public/directives/chart_directive.js +++ b/public/directives/chart_directive.js @@ -1,6 +1,6 @@ var _ = require('lodash'); var $ = require('jquery'); -var moment = require('moment'); +var moment = require('moment-timezone'); require('flot'); require('flotTime'); @@ -11,7 +11,7 @@ require('flotSymbol'); var app = require('ui/modules').get('apps/timelion', []); -app.directive('chart', function ($compile, $rootScope, timefilter, $timeout) { +app.directive('chart', function ($compile, $rootScope, timefilter, $timeout, Private) { return { restrict: 'A', scope: { @@ -19,6 +19,8 @@ app.directive('chart', function ($compile, $rootScope, timefilter, $timeout) { search: '=' }, link: function ($scope, $elem) { + var timezone = Private(require('plugins/timelion/services/timezone'))(); + var legendValueNumbers; var debouncedSetLegendNumbers; var defaultOptions = { @@ -26,6 +28,7 @@ app.directive('chart', function ($compile, $rootScope, timefilter, $timeout) { xaxis: { mode: 'time', tickLength: 0, + timezone: 'browser' }, selection: { mode: 'x', diff --git a/series_functions/es.js b/series_functions/es.js index 8794ab9545412..4b3a0d43ca1a4 100644 --- a/series_functions/es.js +++ b/series_functions/es.js @@ -26,6 +26,7 @@ function buildRequest(config, tlConfig) { date_histogram: { field: config.timefield, interval: config.interval, + time_zone: tlConfig.time.timezone, extended_bounds: { min: tlConfig.time.from, max: tlConfig.time.to