If no end date on front end event form set to start date.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 9 Sep 2016 14:36:11 +0000 (10:36 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 9 Sep 2016 14:37:25 +0000 (10:37 -0400)
Getting issue where the event submitted by the front end form with no
end dates getting set to 1969 date.

index.php
models/front/events/frontAdd.php

index 9fbecbe..48eb46d 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.3.5
+ * Version: 1.3.6
  * 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.3.5
+ * @version 1.3.6
  */
 
 /*
@@ -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.3.5');
+define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.3.6');
 define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.0.22');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index 6ac49e1..bb6241e 100644 (file)
@@ -146,6 +146,9 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents
             $date     = date('y/m/d H:i:s a', time());
             $starting = trim(filter_var($_REQUEST['starting'], FILTER_SANITIZE_STRING));
             $ending   = trim(filter_var($_REQUEST['ending'], FILTER_SANITIZE_STRING));
+            if ( !$ending ) {
+                $ending = $starting;
+            }