mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
76_SMAPortal: contrib 3.6.1
git-svn-id: https://svn.fhem.de/fhem/trunk@23061 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e4f1b2e4f8
commit
5c22b412df
@ -1612,8 +1612,6 @@ sub _getBalanceMonthData { ## no critic "not used"
|
||||
|
||||
my @bd = split /\s+/x ,AttrVal($name, "balanceMonth", "current");
|
||||
my $tag = "balanceMonthData";
|
||||
|
||||
my $d = (localtime(time))[3]; # heutiges Tages-Datum (Tag)
|
||||
|
||||
for my $bal (@bd) {
|
||||
my ($y,$m);
|
||||
@ -1661,16 +1659,18 @@ 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
|
||||
|
||||
eval { timelocal(0, 0, 0, $d, $m, $y) } or do { $state = (split(" at", $@))[0];
|
||||
$errstate = 1;
|
||||
Log3($name, 2, "$name - ERROR - invalid date/time format in attribute 'balanceMonth' detected: $state");
|
||||
return ($errstate,$state,$reread,$retry);
|
||||
};
|
||||
eval { timelocal(0, 0, 0, $dim, $m, $y) } or do { $state = (split(" at", $@))[0];
|
||||
$errstate = 1;
|
||||
Log3($name, 2, "$name - ERROR - invalid date/time format in attribute 'balanceMonth' detected: $state");
|
||||
return ($errstate,$state,$reread,$retry);
|
||||
};
|
||||
|
||||
Log3 ($name, 4, "$name - retrieve $tag ".($y+1900)."-".sprintf "%02d", $m+1);
|
||||
|
||||
my $cts = fhemTimeLocal(0, 0, 0, $d, $m, $y);
|
||||
my $cts = fhemTimeLocal(0, 0, 0, $dim, $m, $y);
|
||||
my $offset = fhemTzOffset($cts);
|
||||
my $anchort = int($cts + $offset); # anchorTime in UTC -> abzurufendes Datum
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user