Fix for event date/time with non-inclusive end dates.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 8 Jun 2017 16:45:55 +0000 (12:45 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 8 Jun 2017 16:45:55 +0000 (12:45 -0400)
Events from icalfeeds that have this format
VALUE=DATE:200170424 for the DTEND date. These end dates are
non-inclusive.

index.php
models/front/events/icalFeedImport.php
readme.txt

index 76e87bf..381c36e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Members Database Events
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: Gaslight Media Members Database.
- * Version: 1.6.43
+ * Version: 1.6.44
  * Author: Chuck Scott
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -20,7 +20,7 @@
  * @package glmMembersDatabaseEventsAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.6.43
+ * @version 1.6.44
  */
 
 /*
@@ -38,7 +38,7 @@
  *  so that we're sure the other add-ons see an up to date
  *  version from this plugin.
  */
-define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.43');
+define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.44');
 define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.2');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index f22ddad..82435dd 100644 (file)
@@ -355,8 +355,16 @@ class GlmMembersFront_events_icalFeedImport
                 $day_of_week       = 127;
                 $month_of_year     = 4095;
                 $week_of_month     = 63;
+
                 $starting          = $ical->iCalDateToUnixTimestamp( $event['DTSTART'] );
-                $ending            = $ical->iCalDateToUnixTimestamp( $event['DTEND'] );
+                // Need to check the DTEND to see if they are non-inclusive
+                // They'll have VALUE=DATE:YYYMMDD format
+                if ( isset( $event['DTEND'] ) && preg_match( '%VALUE=DATE:(\d{4})(\d{2})(\d{2})%', $event['DTEND'], $dParts ) ) {
+                    $ending = mktime( 0, 0, 0, $dParts[2], ((int)$dParts[3] - 1), $dParts[1] );
+                } else {
+                    $ending = $ical->iCalDateToUnixTimestamp( $event['DTEND'] );
+                }
+
                 $from_date         = date( 'Y-m-d', $starting );
                 $to_date           = date( 'Y-m-d', $ending );
                 $btime             = date( 'H:i', $starting );
index 5808a28..466c612 100644 (file)
@@ -26,6 +26,21 @@ e.g.
 
 == Changelog ==
 
+= 1.6.44 =
+
+* Fix for icalFeedImport script to check for events with the start/end date
+  format that have a non-inclusize end date.
+
+= 1.6.43 =
+
+* Fix for the calendar view when not showing member events.
+
+= 1.6.42 =
+
+* Adding pageslug support for the events links in the calendar view
+* Remove the Z ending for the icalfeed that are generated from our event
+  calendar
+
 = 1.6.41 =
 
 * Added clearing of shortcode cache if any admin update is performed that might affect output.