kibana-123
Version:
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic
17 lines (13 loc) • 445 B
JavaScript
const tzDetect = require('jstimezonedetect').jstz;
const moment = require('moment');
module.exports = function timezoneFn(config, Private) {
return function () {
if (config.isDefault('dateFormat:tz')) {
const detectedTimezone = tzDetect.determine().name();
if (detectedTimezone) return detectedTimezone;
else return moment().format('Z');
} else {
return config.get('dateFormat:tz', 'Browser');
}
};
};