- Issue created by @michaelschutz
- π¨π¦Canada joelseguin Ontario, Canada
I have come across this issue as well. If I indicate that an event is full day the event spans across two days in the calendar. I've attempted to change various settings in my smart date field in the view and none seem to have addressed the issue. Happy to offer testing as needed on this.
I've reproduced this in the Views preview as seen in this screenshot:
- Status changed to Postponed: needs info
5 months ago 8:44pm 17 August 2024 I'm sorry about this issue but I don't manage to reproduce it.
I've created a new calendar view on a fresh D11 with smart_date_recur enabled.
I create a node with an "All-day" event repeating weekly.
The result is correct:
Marking this issue as "postponed" because we need a detailed step by step process to reproduce it.
- π¨π¦Canada michaelschutz
Thanks @matthieuscarset, Iβm away for a week so will give more detail when I get back, but just a quick clarification: the issue is not that the all-day event doesnβt repeat properly. The issue is when I have a timed repeating event, letβs say a weekly meeting at 7pm on Thursday. Then I add an all-day event on a Thursday that is not the first instance of that meeting. I would expect the all-day event to be listed first on that day, then the 7pm meeting. But the meeting will be listed first.
I hope that clarifies. Iβll see about reproducing it, screenshot, and documenting it more when I get back.
- Status changed to Active
4 months ago 7:10pm 11 September 2024 - π¨π¦Canada michaelschutz
Hi again, here's more detail on this issue.
Firstly, I need to update the title/scope. It affects the display of all-day events, but it doesn't seem like the all-day event is the cause. The cause is any recurring event.
I've attached a screenshot that may demonstrate more clearly than my written descriptions.
Setup
This is happening on D9 (9.5.11 - the original install I noticed this on), D10 (10.3.3), and D11 (11.0.2 - just saw there's 11.0.3 but haven't updated to that yet) with Smart Date/Smart Date Recur 4.1.6 and Calendar View 2.1.9.
What should happen
All events, whether timed or all-day, whether one-off or recurring, should sort properly within a given day when there are multiple events on that day. All-day events should be listed first on any given day, before any timed events (which means recurring all-day events work fine even with this apparent bug, since they're always listed first anyway).
What is happening
When there is a recurring timed event, the first instance of that recurring event sorts properly with other events that fall on that date, but subsequent instances of that recurring event do not. On subsequent instances, the recurring event is always listed first on that day, even if it shouldn't be.
When the recurring event falls on a day together with an all-day event, the first instance sorts properly, but subsequent instances of the recurring event appear in the wrong order on that day. (Screenshot: on the 16th, an 11am Recurring Meeting begins. The All-Day Test 3 event appears properly before that. However, on the 23rd, I would expect the All-Day Test 4 event to be listed before the 11am Recurring Meeting.)
When the recurring event falls on a day together with other timed events, the same thing happens. (Screenshot: On the 11th, a 12pm Recurring Meeting begins. An 11am Test Event is listed before it, as it should. However, on the 25th, the 12pm Recurring Meeting is listed before the one-off 11am Event.
Possible Explanation
I know this is vague, but there seems to be some odd interaction between the start times of recurring events and one-off events within a given day.
This isn't in the screenshot, but I went back and added a second recurring event on the 16th, 23rd, and 30th, getting it to interact with the 11am Recurring Meeting. The new recurring event sorted properly with the 11am Recurring Meeting whether it was set to 9am or 3pm. Both recurring events were listed before the "All-Day Test 4" event on the 23rd, however.
Steps to Reproduce
- Add a recurring event with a start time.
- Add a one-off event on the same day as one of the instances of the recurring event that is not the first instance.
- The recurring event will be listed first on that day, even if its start time is later than the one-off event.
- πΊπΈUnited States brian.barry@utexas.edu
I'm running into this issue as well, and I think I understand what the problem is. When Date is used as a sort criteria, recurring events are sorted according to the first day on which they occur, regardless of the day on which they are appearing. So if a weekly event starts on October 1, the instance of the event that appears on October 8th will be sorted according to the October 1st date/time, and will therefore appear before any event that only occurs on October 8th. Put another way, this event will sort correctly on October 1st, but will sort incorrectly on every day that it appears after October 1st.
- πΊπΈUnited States brian.barry@utexas.edu
Following up on this: I found what I believe is the source of the problem.
While trying to solve this, I realized that no matter what sort criteria are used, events sort the same way. Looking through the components of the module for some other sorting mechanism, I found this in calendar_view.theme.inc:
// Sort events in each cells to keep order of multiday events. if (count($list) > 1) { usort($list, function ($row1, $row2) { $instance1 = $row1['#values']['first_instance'] ?? NULL; $instance2 = $row2['#values']['first_instance'] ?? NULL; return $instance1 <=> $instance2; }); }
I don't know what problem this is intended to solve, but for this issue it appears to be causing the problem. I removed that function, and the events on each day now appear in the correct order, i.e., chronological for that specific day, rather than chronological according to the first instance of each event. And with that function out of the way, sort criteria in the view are taking effect as they should.
- π¬π§United Kingdom iancawthorne
I think I'm also seeing this issue in possibly a slightly different way. The issue I'm seeing is with a non-recurring multi day event coinciding with a recurring event, but only from the second recursion onwards.
In this scenario, the vertical alignment of the multi day event displays in the incorrect position on the coinciding days.
To re-create:
1) Create a multi day event which does not recur. Eg: 1st December 2024 to 8th December 2024
2) Create a single day event which recurs, and the start date is in the previous week. Eg: 27th November 2024, recurring weekly.When viewing the second instance of (2) on the 4th December 2024, the single day event shows first and the multi day event shows second, breaking the layout of the multi day event.
Commenting out the code as mentioned in #7 and #8 resolves this layout example issue, but I don't think it is the solution, as more complex examples than described here still result in incorrect layout of multi day events.
- π¨π¦Canada michaelschutz
Thanks @brian.barry@utexas.edu - I can confirm that commenting out the function as in #8 does fix my issue. At this point I can live with #9 not being solved, though maybe that requires its own issue to be opened?
Maybe @matthieuscarset can give some insight?