From: Steve Sutton Date: Thu, 8 Jun 2017 16:45:55 +0000 (-0400) Subject: Fix for event date/time with non-inclusive end dates. X-Git-Tag: v1.6.44^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=0941ede86cbddc3d0a3c86f0815b8f35b1e74713;p=WP-Plugins%2Fglm-member-db-events.git Fix for event date/time with non-inclusive end dates. Events from icalfeeds that have this format VALUE=DATE:200170424 for the DTEND date. These end dates are non-inclusive. --- diff --git a/index.php b/index.php index 76e87bf..381c36e 100644 --- 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 * @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. diff --git a/models/front/events/icalFeedImport.php b/models/front/events/icalFeedImport.php index f22ddad..82435dd 100644 --- a/models/front/events/icalFeedImport.php +++ b/models/front/events/icalFeedImport.php @@ -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 ); diff --git a/readme.txt b/readme.txt index 5808a28..466c612 100644 --- a/readme.txt +++ b/readme.txt @@ -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.