diff --git a/calendar/libxpical/oeICalEventImpl.cpp b/calendar/libxpical/oeICalEventImpl.cpp index f73aef98a25d..6c1b9dead223 100644 --- a/calendar/libxpical/oeICalEventImpl.cpp +++ b/calendar/libxpical/oeICalEventImpl.cpp @@ -1052,10 +1052,10 @@ icaltimetype oeICalEventImpl::GetNextRecurrence( icaltimetype begin, bool *isbeg if( icaltime_compare( end , begin ) <= 0 ) continue; - struct icaltimetype nextday = begin; + struct icaltimetype nextday = next; nextday.hour = 0; nextday.minute = 0; nextday.second = 0; icaltime_adjust( &nextday, 1, 0, 0, 0 ); - if( icaltime_compare( nextday, end ) < 0 ) { + if( icaltime_compare( nextday , begin ) > 0 && icaltime_compare( nextday, end ) < 0 ) { PRTime nextdayinms = ConvertToPrtime( nextday ); if( !IsExcepted( nextdayinms ) ) { nextpropagation = nextday;