From 0019101f0eb9370050d134b34db8196109adac95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 13 Apr 2014 15:01:06 +0200 Subject: [PATCH] clarified timezoneOffset setting --- src/app/components/settings.js | 12 +----------- src/config.sample.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/app/components/settings.js b/src/app/components/settings.js index be845b0c722..18fbf5e48a6 100644 --- a/src/app/components/settings.js +++ b/src/app/components/settings.js @@ -24,7 +24,7 @@ function (_, crypto) { default_route : '/dashboard/file/default.json', grafana_index : 'grafana-dash', elasticsearch_all_disabled : false, - timezoneOffset : 'auto', + timezoneOffset : null, }; // This initializes a new hash on purpose, to avoid adding parameters to @@ -59,16 +59,6 @@ function (_, crypto) { }; } - if (settings.timezoneOffset === 'auto' ) - { - //this hack is to deal with graphites poor tz support. It doesn't like - // DST, so we're gonna make a january (non-dst) date and get its offset - var nonDSTDate = new Date(new Date().getFullYear(),0,1); - - //given "Tue Apr 08 2014 08:24:50 GMT-0400 (EDT)", get "-0400" - settings.timezoneOffset = nonDSTDate.toString().split(' ')[5].substring(3); - } - _.each(settings.datasources, function(datasource, key) { datasource.name = key; parseBasicAuth(datasource); diff --git a/src/config.sample.js b/src/config.sample.js index 00d39034550..3673e97c417 100644 --- a/src/config.sample.js +++ b/src/config.sample.js @@ -36,10 +36,16 @@ function (Settings) { default_route: '/dashboard/file/default.json', /** - * If your graphite server has another timezone than you & users browsers specify the offset here - * Example: "-0500" (for UTC - 5 hours) - * If your graphite server runs UTC, you can set this to "auto" and it will pick the right timezone for you + * If you experiance problems with zoom, it is probably caused by timezone diff between + * your browser and the graphite-web application. timezoneOffset setting can be used to have Grafana + * translate absolute time ranges to the graphite-web timezone. + * Example: + * If TIME_ZONE in graphite-web config file local_settings.py is set to America/New_York, then set + * timezoneOffset to "-0500" (for UTC - 5 hours) + * Example: + * If TIME_ZONE is set to UTC, set this to "0000" */ + timezoneOffset: null, grafana_index: "grafana-dash",