From c22b5b68967d255deec802c75d02531d77dee0da Mon Sep 17 00:00:00 2001 From: borisneubert Date: Sat, 26 Jan 2013 14:22:51 +0000 Subject: [PATCH] changed to make repeating events occur COUNT times (was COUNT+1 times before this change) git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2569 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/57_Calendar.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FHEM/57_Calendar.pm b/FHEM/57_Calendar.pm index 92dd70d81..c87c85007 100644 --- a/FHEM/57_Calendar.pm +++ b/FHEM/57_Calendar.pm @@ -476,7 +476,8 @@ sub advanceToNextOccurance { # See RFC 2445 page 39 and following return if(!exists($self->{freq})); #This event is not reoccuring - return if(exists($self->{count}) and $self->{count} == 0); #We are already at the last occurance + $self->{count}-- if(exists($self->{count})); # since we look for the next occurance we have to decrement count first + return if(exists($self->{count}) and $self->{count} <= 0); #We are already at the last occurance my @weekdays = qw(SU MO TU WE TH FR SA); #There are no leap seconds in epoch time @@ -523,7 +524,6 @@ sub advanceToNextOccurance { #the UNTIL clause is inclusive, so $newt == $self->{until} is okey return if(exists($self->{until}) and $nextstart > $self->{until}); - $self->{count} -= 1 if(exists($self->{count})); my $duration = $self->{end} - $self->{start}; $self->{start} = $nextstart;