Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Use browser time for display. Closes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Nov 18, 2015
1 parent ce3f1e7 commit a737495
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timelion",
"version": "0.1.174",
"version": "0.1.175",
"dependencies": {
"body-parser": "^1.12.0",
"boom": "^2.8.0",
Expand Down
7 changes: 4 additions & 3 deletions public/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var _ = require('lodash');

var logoUrl = require('./logo.png');

require('angularSortableView');
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions public/directives/chart_directive.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var _ = require('lodash');
var $ = require('jquery');
var moment = require('moment');
var moment = require('moment-timezone');

require('flot');
require('flotTime');
Expand All @@ -11,21 +11,24 @@ 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: {
chart: '=',
search: '='
},
link: function ($scope, $elem) {
var timezone = Private(require('plugins/timelion/services/timezone'))();

var legendValueNumbers;
var debouncedSetLegendNumbers;
var defaultOptions = {
canvas: true,
xaxis: {
mode: 'time',
tickLength: 0,
timezone: 'browser'
},
selection: {
mode: 'x',
Expand Down
1 change: 1 addition & 0 deletions series_functions/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a737495

Please sign in to comment.