Active
Project:
Calendar Block
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Dec 2008 at 20:27 UTC
Updated:
28 Jul 2010 at 11:34 UTC
Jump to comment: Most recent file
I noticed earlier this week that I had duplicate "todays" (see attached screenshot).
I was able to resolve this issue by replacing the following code in calendar_block.module
if ($calendar->day && $date->day == $calendar->day) {
$class .= ' today';
}
with this:
if ( ($calendar->day == $date->day) && ($calendar->month == $date->month) ) {
$class .= ' today';
}
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | broken.jpg | 19.46 KB | usa2k |
| #5 | unbroken.jpg | 19.09 KB | usa2k |
| duplicate_today.png | 12.48 KB | jmstacey |
Comments
Comment #1
jmstacey commentedI haven't run through the code yet, but this change might break cases where the "today" is not on the current month but still viewable. For example, if today was January 1 and the calendar view was on December, January 1 is visible but since it's not on the same month that is viewable it won't be indicated as today. I haven't had time to test it yet.
Comment #2
skilip commentedAgain, thanks for your report jmstacey! I should make you co-maintainer, if you'd feel like it! I will add your code and test it asap.
Comment #3
kjy07 commentedRather than comparing the Calendar Display's month/day to the Day's month/day, compare the Day's month/day to the *current* month/day. This will ensure that multiple "todays" don't appear and also take disabled "todays" into account.
Comment #4
jbomb commentedThis is still relevant in the D6 branch. I used the solution provided in #3.
Comment #5
usa2k commented#3 worked for me today on Calendar Block 6.x-2.2