fixing the end date for the events in case the last day is changed in the
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 31 Jan 2017 18:49:53 +0000 (13:49 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 31 Jan 2017 18:49:53 +0000 (13:49 -0500)
admin.

models/admin/ajax/eventsCalMonthAJAX.php
views/front/events/sidebarEvents.html

index 6b852d0..0561169 100644 (file)
@@ -174,9 +174,9 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
                 }
 
                 $date = $wpdb->get_results($sql);
-                
+//                $dates[] = $date;
                 if(count($date) > 1){
-                    $end_date = date('M d', strtotime($date[1]->end_time));
+                    $end_date = date('M d', strtotime(end($date)->end_time));
                 } else {
                     $end_date = '';
                 }
@@ -272,6 +272,7 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
             'message'         => $info,
             'sidebar_events'  => $sidebar_events,
             'array_dates'     => $arrayDates,
+//            'event'           => $dates
         );
 
         header('Content-type:application/json;charset=utf-8', true);
index bca3bfa..57709b7 100644 (file)
@@ -25,6 +25,8 @@
                     $('.sidebar-event').fadeIn("slow");
                 },
                 success: function(data){
+                    console.log(data.event);
+                
                       if(data.array_dates !== null){
                         var num = 0;
                         $.each(data.array_dates, function(index, value){