Skip to content

Commit

Permalink
Moving timezone functions from Timelion to Vis (#13457)
Browse files Browse the repository at this point in the history
* Moving timezone functions from Timeline to global

* Fixing a missing require
  • Loading branch information
simianhacker committed Aug 10, 2017
1 parent 24a3c39 commit 3e20172
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/core_plugins/timelion/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import moment from 'moment-timezone';
import { DocTitleProvider } from 'ui/doc_title';
import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_registry';
import { notify } from 'ui/notify';
import { timezoneProvider } from 'ui/vis/lib/timezone';

require('plugins/timelion/directives/cells/cells');
require('plugins/timelion/directives/fixed_element');
Expand Down Expand Up @@ -75,7 +76,7 @@ app.controller('timelion', function (
});

const savedVisualizations = Private(SavedObjectRegistryProvider).byLoaderPropertiesName.visualizations;
const timezone = Private(require('plugins/timelion/services/timezone'))();
const timezone = Private(timezoneProvider)();
const docTitle = Private(DocTitleProvider);

const defaultExpression = '.es(*)';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import _ from 'lodash';
import { dashboardContextProvider } from 'plugins/kibana/dashboard/dashboard_context';

import { timezoneProvider } from 'ui/vis/lib/timezone';
const TimelionRequestHandlerProvider = function (Private, Notifier, $http, $rootScope, timefilter) {
const timezone = Private(require('plugins/timelion/services/timezone'))();
const timezone = Private(timezoneProvider)();
const dashboardContext = Private(dashboardContextProvider);

const notify = new Notifier({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const tzDetect = require('jstimezonedetect').jstz;
import moment from 'moment';

export default function timezoneFn(config) {
export function timezoneProvider(config) {
return function () {

if (config.isDefault('dateFormat:tz')) {
Expand All @@ -14,3 +14,4 @@ export default function timezoneFn(config) {

};
}

0 comments on commit 3e20172

Please sign in to comment.