Changed date range returned for an event in an event list.
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 27 Jul 2018 17:06:46 +0000 (13:06 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 30 Jul 2018 18:06:33 +0000 (14:06 -0400)
This was showing the date range selected for the list of evnets rather than the date reange for the specific event.
Now showing the correct date range for the entire event.

models/front/events/baseAction.php

index f284c6b..f07795a 100644 (file)
@@ -365,12 +365,12 @@ abstract class GlmMembersFront_events_baseAction extends GlmDataEvents
                     $firstKey = key( $event['times'] );
                     reset( $event['times'] );
                 }
-                $event['dates'] = $this->getEventDate(
-                    strtotime( $event['starting_date'] ),
-                    strtotime( $event['ending_date'] ),
-                    'timestamp'
-                );
-                $event['recurDays'] = $this->getEventRecurDays( $event );
+
+                // Get human-readable date range for this event.
+                // This replaced code that was using the date range selected rather than the date range for the entire event - now doing entire event.
+                $d = $this->getFirstAndLastTimes($event['id']);
+                $event['dates'] = $this->getEventDate( strtotime($d['first']), strtotime($d['last']), 'timestamp');
+
             }
         }
         $this->postAddTimes = false;