Remove some timezone detail which is breaking windows
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 30 Aug 2016 16:29:43 +0000 (12:29 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 30 Aug 2016 16:38:02 +0000 (12:38 -0400)
For some reason windows machines are given very strange time zones.
This is breaking the strtotime calls.

models/admin/ajax/eventsCalMonthAJAX.php

index b8e0444..ad3bf47 100644 (file)
@@ -124,8 +124,16 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
                 'last'  => FILTER_SANITIZE_STRING
             )
         );
-        $from = date('Y-m-d', strtotime($month['start']));
-        $to   = date('Y-m-d', strtotime($month['last']));
+        $start = preg_replace( '%\(.*\)%', '', $month['start'] );
+        $last  = preg_replace( '%\(.*\)%', '', $month['last'] );
+
+        $from = date('Y-m-d', strtotime($start));
+        $to   = date('Y-m-d', strtotime($last));
+
+        echo '<pre>$from: ' . print_r( $from, true ) . '</pre>';
+        echo '<pre>$to: ' . print_r( $to, true ) . '</pre>';
+        echo '<pre>$month: ' . print_r( $month, true ) . '</pre>';
+        exit;
 
         $this->dateRange = "start_time BETWEEN CAST('{$from}' AS DATE) AND CAST('{$to}' as DATE)";
         $this->dateRange = "id IN (