From 0706ec38423e455c145ceaa566c5161ef26554b2 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 15 Feb 2017 11:52:51 -0500 Subject: [PATCH] Bugs #0000065 Set end date when start date is set When entering a Start date for event set the end date to the same date. This will help people entering events. --- index.php | 6 +++--- js/front.js | 6 +++++- views/admin/events/edit.html | 12 +++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index 6110be9..1754d7e 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.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 * @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. diff --git a/js/front.js b/js/front.js index e7f109f..9fd63da 100644 --- a/js/front.js +++ b/js/front.js @@ -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' }); diff --git a/views/admin/events/edit.html b/views/admin/events/edit.html index 8dfa4a2..db8f4dc 100644 --- a/views/admin/events/edit.html +++ b/views/admin/events/edit.html @@ -24,7 +24,7 @@ {if $eventAdded}Event Added{/if} {if $eventAddError}Event Add Error{/if} - + {if $eventUpdateError || $eventAddError}

NOTICE: Your event has not yet been submitted.
Please select the tabs indicating a problem, correct the indicated fields and resubmit.

{else} @@ -32,7 +32,7 @@

NOTICE: Your event does not have any selected dates/times. Please check your schedule in the "Dates" tab below.

{/if} {/if} - + {if $haveMember && !$lockedToMember}
@@ -469,7 +469,13 @@ 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 -- 2.17.1