2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-19 12:46:03 +00:00

98_SVG.pm: fix Feb29 for fixedrange=month (Forum #108900)

git-svn-id: https://svn.fhem.de/fhem/trunk@21338 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-03-02 16:57:22 +00:00
parent a4c2da3cad
commit 842bb4ebd7

View File

@ -1017,20 +1017,18 @@ SVG_calcOffsets($$)
}
$l[4] += $off;
$l[4] += 12, $l[5]-- if($l[4] < 0);
my @me = (31,28,31,30,31,30,31,31,30,31,30,31);
my @me = (31,29,31,30,31,30,31,31,30,31,30,31); # 29 is fixed in SVG_tspec
if(SVG_Attr($FW_wname, $wl, "endPlotToday", undef)) {
$sy = $ey = $l[5];
$sm = $l[4]-1; $em = $l[4];
$sm += 12, $sy-- if($sm < 0);
$sd = $l[3]+1; $ed = $l[3];
$me[1]++ if(($sy+1900)%4); # leap year. Ignore 1900 and 2100 :)
$sd=1, $sm=$em, $sy=$ey if($sd > $me[$sm]);
} else {
$sy = $ey = $l[5];
$sm = $em = $l[4];
$me[1]++ if(($sy+1900)%4); # leap year. Ignore 1900 and 2100 :)
$sd = 1; $ed = $me[$l[4]];
}
$SVG_devs{$d}{from} = SVG_tspec( 0, 0, 0,$sd,$sm,$sy);