2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 23:36:37 +00:00

76_SMAPortal: contrib 3.6.1

git-svn-id: https://svn.fhem.de/fhem/trunk@23062 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-10-31 16:17:33 +00:00
parent 5c22b412df
commit 9eb6b2a3d2

View File

@ -137,7 +137,7 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
"3.6.1" => "31.10.2020 ",
"3.6.1" => "31.10.2020 adjust anchortime in getBalanceMonthData ",
"3.6.0" => "11.10.2020 new relative time arguments for attr balanceDay, balanceMonth, balanceYear, new attribute useRelativeNames ",
"3.5.0" => "10.10.2020 _getLiveData: get data from Dashboard instead of homemanager site depending of attr noHomeManager, ".
"extract OperationHealth key, new attr cookieDelete ",
@ -1660,7 +1660,7 @@ sub _getBalanceMonthData { ## no critic "not used"
$addon = createDateAddon ($params);
}
my $dim = $m+1-2 ? 30+(($m+1)*3%7<4) : 28+!(($y+1900)%4||($y+1900)%400*!(($y+1900)%100)); # errechnet wieviel Tage der Monat hat
my $dim = daysInMonth ($m+1, $y+1900); # errechnet wieviel Tage der gegebene Monat hat
eval { timelocal(0, 0, 0, $dim, $m, $y) } or do { $state = (split(" at", $@))[0];
$errstate = 1;
@ -3178,6 +3178,21 @@ sub delReadingFromBlocking {
return 1;
}
################################################################
# errechnet wieviel Tage ein gegebener Monat eines
# bestimmten Jahres hat
# $m: realer Monat (1..12)
# $y: reales Jahr (2020)
################################################################
sub daysInMonth {
my $m = shift;
my $y = shift;
my $dim = $m-2?30+($m*3%7<4):28+!($y%4||$y%400*!($y%100));
return $dim;
}
################################################################
# Timestamp korrigieren
################################################################