From f0b3d5f2c30b792be3837a82eae2f6c8e07d96eb Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Mon, 28 Mar 2016 13:13:38 -0400 Subject: [PATCH] Fixed problem with not selecting last date in a sequence. --- classes/data/dataRecurrences.php | 7 ++++--- views/admin/events/edit.html | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/classes/data/dataRecurrences.php b/classes/data/dataRecurrences.php index 718d468..49ceb02 100644 --- a/classes/data/dataRecurrences.php +++ b/classes/data/dataRecurrences.php @@ -371,8 +371,8 @@ class GlmDataEventsRecurrences extends GlmDataAbstract } // Overall range to scan for event times - $from = new DateTime($recurData['from_date']['date']); - $to = new DateTime($recurData['to_date']['date']); + $from = new DateTime($recurData['from_date']['date'].' 00:00'); + $to = new DateTime($recurData['to_date']['date'].' 00:00'); // Calculate interval for single event - If start time only, then start and end are the same $start = new DateTime($recurData['start_time']['datetime']); @@ -449,8 +449,9 @@ class GlmDataEventsRecurrences extends GlmDataAbstract $dates[$start->getTimestamp()] = $start; } - // Create From and to timestamp for comparison + // Create From and to timestamp for comparison - Make to date +1 day $fromTime = $from->getTimestamp(); + $to->modify('+1 day'); $toTime = $to->getTimestamp(); // Check for $replace, if so delete all existing entries and custom events diff --git a/views/admin/events/edit.html b/views/admin/events/edit.html index f765bee..fe12489 100644 --- a/views/admin/events/edit.html +++ b/views/admin/events/edit.html @@ -161,7 +161,8 @@ {/foreach} ], defaultDate : '{$firstTime.start_time.datetime}', - timeFormat : 'h:mma' + timeFormat : 'h:mma', + fixedWeekCount : false {/if} }); -- 2.17.1