mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
98_SVG.pm: implement endPlotNow&endPlotToday for fixedRange year (Forum #18267)
git-svn-id: https://svn.fhem.de/fhem/trunk@16117 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ba30069cee
commit
9d4aa35b7b
@ -1056,10 +1056,22 @@ SVG_calcOffsets($$)
|
||||
|
||||
} elsif($zoom eq "year") {
|
||||
my @l = localtime($now);
|
||||
$l[5] += $off;
|
||||
$SVG_devs{$d}{from} = sprintf("%04d-01-01_00:00:00", $l[5]+1900);
|
||||
$SVG_devs{$d}{to} = sprintf("%04d-01-01_00:00:01", $l[5]+1901);
|
||||
if(SVG_Attr($FW_wname, $wl, "endPlotToday", undef)) {
|
||||
$l[5] += ($off-1); $l[3]++; # 00:00 off+1 years ago
|
||||
$SVG_devs{$d}{from} = SVG_tspec(3, 0, @l);
|
||||
$l[5]++; $l[3]--; $l[2]=23; $l[1]=59; # today, 23:59
|
||||
$SVG_devs{$d}{to} = SVG_tspec(0, 59, @l);
|
||||
|
||||
} elsif(SVG_Attr($FW_wname, $wl, "endPlotNow", undef)) {
|
||||
$l[5] += ($off-1); $l[3]++; # Now, off+1 years ago
|
||||
$SVG_devs{$d}{from} = SVG_tspec(0, $l[0], @l);
|
||||
$l[5]++; $l[3]--; # now
|
||||
$SVG_devs{$d}{to} = SVG_tspec(0, $l[0], @l);
|
||||
|
||||
} else {
|
||||
$SVG_devs{$d}{from} = SVG_tspec(0, 0, 0, 0, 0, 1, 0,$l[5]);#Jan01 00:00:00
|
||||
$SVG_devs{$d}{to} = SVG_tspec(0,59,59,59,23,31,11,$l[5]);#Dec31 23:59:59
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user