Update agenda view for how many event weeks to go out to.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 15 Feb 2017 19:55:47 +0000 (14:55 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 15 Feb 2017 19:55:47 +0000 (14:55 -0500)
the total events may match the number wanted so these need to be with
equal. removed the equal on the first part.

models/front/events/list.php

index a8c9421..23a10fc 100644 (file)
@@ -174,7 +174,7 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction
                 $event_count    = 0;
                 do {
                     $event_count = $this->getEventCountForWeekRange( ++$weeks_to_check, $memberId );
-                } while ( $event_count <= $total_events_wanted && $total_current_events > $total_events_wanted );
+                } while ( $event_count < $total_events_wanted && $total_current_events >= $total_events_wanted );
 
                 $week_string = ( $weeks_to_check === 1 ) ? 'weeks': 'week';
                 $toDate = date('m/d/Y', strtotime( '+ ' . $weeks_to_check . ' ' . $week_string ));