Bugs #0000065 Set end date when start date is set
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 15 Feb 2017 16:52:51 +0000 (11:52 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 15 Feb 2017 16:52:51 +0000 (11:52 -0500)
When entering a Start date for event set the end date to the same date.
This will help people entering events.

index.php
js/front.js
views/admin/events/edit.html

index 6110be9..1754d7e 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.7
+ * Version: 1.6.8
  * 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.7
+ * @version 1.6.8
  */
 
 /*
@@ -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.7');
+define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.8');
 define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.1');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index e7f109f..9fd63da 100644 (file)
@@ -21,7 +21,11 @@ var EventFront = {
 
         // load front end form submission jquery if elements exist
         if(jQuery("#frontForm").length > 0){
-            jQuery("#sdate, #edate").datepicker({
+            jQuery("#sdate").datepicker({
+                dateFormat: 'mm/dd/yy',
+                altField: '#edate'
+            });
+            jQuery("#edate").datepicker({
                 dateFormat: 'mm/dd/yy'
             });
 
index 8dfa4a2..db8f4dc 100644 (file)
@@ -24,7 +24,7 @@
         {if $eventAdded}<span class="glm-notice glm-flash-updated">Event Added</span>{/if}
         {if $eventAddError}<span class="glm-error glm-flash-updated">Event Add Error</span>{/if}
     </h2>
-  
+
   {if $eventUpdateError || $eventAddError}
     <h1 class="glm-error">NOTICE: Your event has not yet been submitted.<br>Please select the tabs indicating a problem, correct the indicated fields and resubmit.</h1>
   {else}
@@ -32,7 +32,7 @@
     <h1 class="glm-error">NOTICE: Your event does not have any selected dates/times. Please check your schedule in the "Dates" tab below.</h1>
     {/if}
   {/if}
-    
+
   {if $haveMember && !$lockedToMember}
     <form action="{$thisUrl}?page=glm-members-admin-menu-member" method="post" enctype="multipart/form-data">
         <input type="hidden" name="glm_action" value="events">
                     lang: 'en',
                     step: 15,
                     closeOnWithoutClick: true,
-                    timepicker: false
+                    timepicker: false,
+                    onSelectDate: function(ct,input){
+                        var name = input[0].name;
+                        var val = input[0].value;
+                        var matched = name.match(/(.*)_from_date/);
+                        $('input[name="' + matched[1] + '_to_date"]').val(val);
+                    }
                 });
 
                 // Time Only Pickers