From: Steve Sutton Date: Fri, 7 Sep 2018 20:06:12 +0000 (-0400) Subject: Fix for the end time X-Git-Tag: v1.6.101^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=9fd12d41e8eeb09f55f01cecb8957fe4c3613ff9;p=WP-Plugins%2Fglm-member-db-events.git Fix for the end time If empty then use the start time. --- diff --git a/index.php b/index.php index 147dce2..8e2d037 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Associate - Events Add-On * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.6.100 + * Version: 1.6.101 * Author: Chuck Scott * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -19,7 +19,7 @@ * @package glmMembersDatabaseEventsAddOn * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.6.100 + * @version 1.6.101 */ // Check that we're being called by WordPress. @@ -43,7 +43,7 @@ if (!defined('ABSPATH')) { * 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.100'); +define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.101'); define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.6'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/models/front/events/baseAction.php b/models/front/events/baseAction.php index 4cb5d4a..b71075b 100644 --- a/models/front/events/baseAction.php +++ b/models/front/events/baseAction.php @@ -377,8 +377,10 @@ abstract class GlmMembersFront_events_baseAction extends GlmDataEvents // Get human-readable date range for this event. // This replaced code that was using the date range selected rather than the date range for the entire event - now doing entire event. - $d = $this->getFirstAndLastTimes($event['id']); - $event['dates'] = $this->getEventDate( strtotime($d['first']), strtotime($d['last']), 'timestamp'); + $d = $this->getFirstAndLastTimes($event['id']); + $startTime = $d['first']; + $endTime = ( $d['last'] ) ? $d['last']: $d['first']; + $event['dates'] = $this->getEventDate( strtotime($startTime), strtotime($endTime), 'timestamp'); } }