Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving timezone functions from Timelion to Vis #13457

Merged
merged 3 commits into from
Aug 10, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,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) {

};
}