added option to flot to recalculate timestamps in local time.

use this options in vz options.
This commit is contained in:
Jakob Hirsch 2011-04-07 09:01:54 +08:00 committed by Steffen Vogel
parent 0f842f375a
commit b849ae009f
2 changed files with 3 additions and 0 deletions

View file

@ -1238,6 +1238,8 @@
};
formatter = function (v, axis) {
if (opts.useLocalTime)
v -= new Date(v).getTimezoneOffset()*60000;
var d = new Date(v);
// first check global format

View file

@ -53,6 +53,7 @@ vz.options.plot = {
legend: { show: false },
xaxis: {
mode: 'time',
useLocalTime: true,
max: new Date().getTime(), // timeinterval to request
min: new Date().getTime() - vz.options.defaultInterval,
monthNames: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],