using datetime instead of time stamp for event grouping
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 8 Feb 2018 16:11:53 +0000 (11:11 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 8 Feb 2018 16:11:53 +0000 (11:11 -0500)
using timestamp doesn't work because some events have different times

models/admin/ajax/eventsCalMonthAJAX.php

index ef937ab..828f1a0 100644 (file)
@@ -122,7 +122,20 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
         $string= strtolower(str_replace(" ", '-',$string));
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
     }
-
+    
+    /*
+     * AJAX Debugging
+     *
+     */
+    function write_log ( $log )  {
+        if ( true === WP_DEBUG ) {
+            if ( is_array( $log ) || is_object( $log ) ) {
+                error_log( print_r( $log, true ) );
+            } else {
+                error_log( $log );
+            }
+        }
+    }
     /*
      * Perform Model Action
      *
@@ -247,9 +260,9 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
                             'url'        => GLM_MEMBERS_EVENTS_SITE_BASE_URL . 'event-detail/' . $event_recur[0]->name_slug . "/"
                         );
 
-                    $datesArray[$event['start_time']['timestamp']][] = $event_data;
+                    $datesArray[$start_timestamp][] = $event_data;
                 }
-               
+                
             }
  
    // end section for front page events widget data