Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When a node's date field does not include an end time, that node is displayed as a multi-day event on the calendar month view. Because it is not actually a multi-day event, it gets cut off in the calendar. See the attached screenshots for the event when it's assigned the "multi-day" class and when I manually change it to the "single-day" class.
Comment | File | Size | Author |
---|---|---|---|
#32 | calendar-multiday-week-issue-1264520-32.patch | 6.14 KB | oleg chemerys |
#31 | calendar-multiday-week-issue-1264520-31.patch | 5.35 KB | oleg chemerys |
#25 | multiday_issue.patch | 2.24 KB | andyhu |
#26 | multiday_issue.patch | 2.43 KB | andyhu |
#20 | no end date week view.jpg | 27.6 KB | carole |
Comments
Comment #1
mErilainen CreditAttribution: mErilainen commentedHmm, I don't see this in month view, but instead in day and week views.
I posted a patch to #1269470: All events are shown twice because I had duplicate results, I think the other item was always multiday because of the incorrect date calculations. You can try that patch if it helps.
But as I said, I experience this issue in week and day views.
Comment #2
jackalope CreditAttribution: jackalope commentedHmm... I'm still seeing the same behavior in the Calendar month and week views, but NOT in the day view. Strange! I'm using the most recent 7.x-3.x-dev version. I tried your patch just in case, mErilainen, even though it seems unrelated, but it has no effect. Thanks anyhow!
Comment #3
mErilainen CreditAttribution: mErilainen commentedHave you tried in Views to change the time grouping setting which both the day and the week display offer? Changing that to "hour" might change the events from multi-day to single ones.
Comment #4
nemo_Anhoa CreditAttribution: nemo_Anhoa commentedIs there any other method than change settings for this one ?
I got the css class turn into multi-day also.
Comment #5
afsolano CreditAttribution: afsolano commentedsubscribing -- same issue
Comment #6
davident CreditAttribution: davident commentedsubscribing -- same issue
My temp fix was to use some jQuery to remove the 'multi-day' class from the td.
Comment #7
thinkdrupal CreditAttribution: thinkdrupal commentedI have a node with an end date and I have this issue. Any event on the last day of the month will show as multiday on the first day of the next month.
Comment #8
pbfleetwood CreditAttribution: pbfleetwood commentedI have the same problem on both month and week displays.
Comment #9
pbfleetwood CreditAttribution: pbfleetwood commentedIt's been four months since this issue was opened. Has anyone come up with a workaround?
I've tried to get around it by making the single day and multi-day events look the same via css, but this is rather complicated and one doesn't want to mess up the display of true multi-day events.
I'm bumping the priority.
Comment #10
Morn CreditAttribution: Morn commentedSetting Mutlti-day style (in the Month Options) as
"Display multi-day item as a single column"
is an easy workaround.
Comment #11
pbfleetwood CreditAttribution: pbfleetwood commentedThank you, @Morn. What you suggest in #10 helps somewhat, in that the text is not truncated, but it makes the true multi-day events appear awkward: they cannot be highlighted by styling, and since they repeat each day, they could become staggered, which would look very sloppy. What is needed is a means of preventing the assignment of the multi-day class to items that are not multi-day.
Comment #12
bennettee CreditAttribution: bennettee commentedI experienced this same issue and tracked it to the following line of code.
In calendar_build_week_day function in the calendar_plugin_style.inc file:
change
$all_day = $item->calendar_start_date == $item->calendar_end_date;
to
$all_day = $item->calendar_all_day;
I don't know if this causes any side-effects, but it seems to fix the problem for me. I hope this helps...I would have submitted a patch for review, but I'm not very familiar with git.
(I originally reported this potential fix in #1264596: Week view shows event in All Day instead of from hour - till hour which I believe was a separate but similar issue.)
Comment #13
pbfleetwood CreditAttribution: pbfleetwood commentedThank you, @bennettee. I'm not using the Week display, but I'll try to see if I can track down similar code that could be affecting the Month display.
Comment #14
bennettee CreditAttribution: bennettee commented@pbfleetwood: IIRC, changing that line fixes all of the displays. It definitely fixes the Month display, though, as that is the only display I am using. Good luck!
Comment #15
pbfleetwood CreditAttribution: pbfleetwood commentedThanks, @bennettee, the code change in #12 works like a charm. I wish that I new a way to override this code without having to directly edit the file in the module; I finally read how to do that with theme_* functions, but that doesn't apply here. Anyway, your fix seems to work very well.
Comment #16
jackalope CreditAttribution: jackalope commented@bennette, thank you so much for figuring this out! I tried your fix and it worked well. I've turned it into a patch which I've hopefully created properly (the advanced patch contributor guide was very helpful, but this was my first shot at doing it the right way.)
Comment #17
carole CreditAttribution: carole commentedI've made the change to no effect in any view; the td class is still multi-day. Using latest dev releases of Date, Calendar; cleared cache; here's the code for a double-check; anyone see the error?
foreach ($hour as $key => $item) {
// CS Carole replaced this original line with the next one line per http://drupal.org/node/1264520
// $all_day = $item->calendar_start_date == $item->calendar_end_date;
//
$all_day = $item->calendar_all_day;
Comment #18
SomethingOn CreditAttribution: SomethingOn commentedThanks Morn your solution worked for me :D
Comment #19
KarenS CreditAttribution: KarenS commentedConfirmed the problem and the fix. Thanks!
http://drupalcode.org/project/calendar.git/commit/33abfbb
Comment #20
carole CreditAttribution: carole commentedI applied the patch and still have the issue in Week & Month views. Cleared cache.
Comment #21
KarenS CreditAttribution: KarenS commentedThis already fixed in dev, there is no patch to apply. You need to use the latest dev of Date and Calendar.
Comment #23
drzraf CreditAttribution: drzraf commentedI can reproduce using 7.x-3.x-dev
Seems like there are 2 issues :
An "all day" event is considered as a multi-day.
The multi-day class breaks display (what was the subject of this issue but wasn't fixed).
Comment #24
drzraf CreditAttribution: drzraf commentedin
calendar_plugin_style.inc
, the following needs explanation (and fixes too):if ($wday == 0 || $start_ydate == $cur_ydate || ($this->date_info->granularity == 'month' && $day_no == 1) || ($all_day && !$is_multi_day))
I've an "all day" event which is not a multi-day, thus :
$all_day = TRUE; $is_multi_day = FALSE
but the above conditional passes, thus
$multiday_buckets
is filledthus
$multiday_buckets[$wday][$index]['filled']
incalendar_build_month()
thus the display bug.
But even changing this strange condition,
$start_ydate == $cur_ydate
is TRUE too.Fixing the CSS would probably be needed too, but there's definitely a bug here which needs to get fixed.
Comment #25
andyhu CreditAttribution: andyhu commentedTested with #16 in newest 7.x-3.x-dev, the issue still occurs with a view built with default template which doesn't have an end date. I've made a patch to fix it. The patch also fixes two issues in other tickets which cause all the events in the 7th day of a week not showing at all (depending on whether Monday or Sunday is set as the first day of a week, this could be Saturday or Sunday), as well as an issue that only the first event is shown for every day if the events are not grouped in the week view. Please check the other two tickets here:
http://drupal.org/node/1779154
http://drupal.org/node/1779142
Comment #26
andyhu CreditAttribution: andyhu commentedsorry, please try the latest one
Comment #27
drzraf CreditAttribution: drzraf commenteddoes not solve the bug in my above case
[ please note that your patch is not git-formatted ]
Comment #28
agerson CreditAttribution: agerson commentedThis is still a problem. I worked around it with "Display multi-day item as a multiple column row"
Comment #29
jaysonjaynes CreditAttribution: jaysonjaynes commentedI'm seeing this as well. Events marked as "All day" are treated like Multi-day events, and are adding an empty
Comment #30
tomdisher CreditAttribution: tomdisher commentedBumping this again - seems like we're still having this issue. My "all day" events are getting the "multi-day" class.
Comment #31
oleg chemerys CreditAttribution: oleg chemerys commentedIt was still an issue for me, so I wrote a small patch. Hope it will help.
Comment #32
oleg chemerys CreditAttribution: oleg chemerys commentedFound a small issue in my patch. When there was no events on week view, you got an error. Fixed in new patch.
Comment #33
francescosciamanna CreditAttribution: francescosciamanna commented#28 solved the problem for me.
Comment #34
joelpittetComment #35
joelpittetCan you remove the changes in the patch that are unrelated to the fix? Sorry I know this is a really late review, but the whitespace fixes cause conflicts with other patches in the queue potentially and make it hard to review the actual fix.
Comment #36
joshuautley CreditAttribution: joshuautley commentedI'm experiencing this with version 7.x-3.6. The above code doesn't seem applicable anymore. Any suggestions?
Some history on how I got here... I updated the Date module from 7.x-2.10 to 7.x-2.11 then back to 7.x-2.10. Most searches around the Date module point back to the Calendar module.
Thank you in advance for any insight.