Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
"js-yaml": "3.4.1",
"json-stringify-pretty-compact": "1.0.4",
"json-stringify-safe": "5.0.1",
"jstimezonedetect": "1.0.5",
"leaflet": "1.0.3",
"leaflet-draw": "0.4.10",
"leaflet-responsive-popup": "0.2.0",
Expand Down
5 changes: 2 additions & 3 deletions src/ui/public/agg_types/buckets/date_histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
* under the License.
*/

import { jstz as tzDetect } from 'jstimezonedetect';
import _ from 'lodash';
import chrome from '../../chrome';
import moment from 'moment';
import moment from 'moment-timezone';
import '../../filters/field_type';
import '../../validate_date_interval';
import { BucketAggType } from './_bucket_agg_type';
Expand All @@ -32,7 +31,7 @@ import { timefilter } from '../../timefilter';
import dropPartialTemplate from '../controls/drop_partials.html';

const config = chrome.getUiSettingsClient();
const detectedTimezone = tzDetect.determine().name();
const detectedTimezone = moment.tz.guess();
const tzOffset = moment().format('Z');

function getInterval(agg) {
Expand Down
5 changes: 2 additions & 3 deletions src/ui/public/vis/lib/timezone.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
* under the License.
*/

const tzDetect = require('jstimezonedetect').jstz;
import moment from 'moment';
import moment from 'moment-timezone';

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

if (config.isDefault('dateFormat:tz')) {
const detectedTimezone = tzDetect.determine().name();
const detectedTimezone = moment.tz.guess();
if (detectedTimezone) return detectedTimezone;
else return moment().format('Z');
} else {
Expand Down
1 change: 0 additions & 1 deletion x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@
"joi": "^13.5.2",
"jquery": "^3.3.1",
"jsonwebtoken": "^8.3.0",
"jstimezonedetect": "1.0.5",
"lodash": "npm:@elastic/lodash@3.10.1-kibana1",
"lodash.clone": "^4.5.0",
"lodash.keyby": "^4.6.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { jstz as tzDetect } from 'jstimezonedetect';
import moment from 'moment';
import moment from 'moment-timezone';

export class XpackWatcherTimezoneService {
constructor(config) {
Expand All @@ -19,7 +18,7 @@ export class XpackWatcherTimezoneService {
return this.config.get(DATE_FORMAT_CONFIG_KEY);
}

const detectedTimezone = tzDetect.determine().name();
const detectedTimezone = moment.tz.guess();
if (detectedTimezone) {
return detectedTimezone;
}
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12713,11 +12713,6 @@ jsprim@^1.2.2:
json-schema "0.2.3"
verror "1.10.0"

jstimezonedetect@1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/jstimezonedetect/-/jstimezonedetect-1.0.5.tgz#93d035cd20e8c7d64eb1375cf5aa7a10a024466a"
integrity sha1-k9A1zSDox9ZOsTdc9ap6EKAkRmo=

jstransformer-ejs@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/jstransformer-ejs/-/jstransformer-ejs-0.0.3.tgz#04d9201469274fcf260f1e7efd732d487fa234b6"
Expand Down