Fix for the end time
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 7 Sep 2018 20:06:12 +0000 (16:06 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 7 Sep 2018 20:06:12 +0000 (16:06 -0400)
If empty then use the start time.

index.php
models/front/events/baseAction.php

index 147dce2..8e2d037 100644 (file)
--- 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 <cscott@gaslightmedia.com>
  * @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.
index 4cb5d4a..b71075b 100644 (file)
@@ -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');
 
             }
         }