a.gneady wrote: ↑2020-04-09 13:37
zibrahim wrote: ↑2020-04-05 02:55
Hi guys,
I am using this new plugins a lot and I noticed that if the event started more that 2 weeks before it cross the following month, it will not be shown in the following month.
Example, my event start on April 25th 2020 and last until May 10th 2020. The event bar only will show up until 2nd May in the April Month view and when I click to the following month (May), I will not see the event anymore in the May calendar view.
But if I change the event start on April 26th, then I can see the continuity in the May calendar.
Appreciate if someone can verify this.
Thanks guys. Stay at Home.
Zala.
Staying at Home.
I'll investigate this issue and see if it can be fixed. My guess is that fullcalendar issues an ajax request to retrieve events, with a specific start and end date ... The ajax response sends the events in the requested date range ... but maybe this needs to be changed so that the events sent are those starting a bit earlier than the specified start date. I'll investigate this and make the necessary fixes in the next release.
Alternatively, you can in the meantime edit file <application-root>/plugins/calendar/generate.php and delete line 431 so:
428 $eo = array('silentErrors' => true);
429 $res = sql(
430 "SELECT {$fields} FROM {$from} AND
431 `{$table}`.`{$startDateField}` >= '{$start}' AND
432 ({$eventDatesWhere}) AND
433 ({$customWhere})", $eo
434 );
becomes:
428 $eo = array('silentErrors' => true);
429 $res = sql(
430 "SELECT {$fields} FROM {$from} AND
431 ({$eventDatesWhere}) AND
432 ({$customWhere})", $eo
433 );
You will then be able to view calendar entries which start in an earlier month but also cover days within the current month view.
The original SQL conditional fragment enforced retrieving entries ONLY where they commence during the CURRENT month which is the reason why the moment a user switches to the next month, they don't see ongoing calendar entries. As far as I can tell, this change has no negative consequences and multi-month calendar entries are now included and displayed correctly.
This change only needs to be made once since generate.php is a static file, used to create calendar specific PHP and JS file content in the hooks folder.
I hope that helps!