'Year view' view not being styled as expected
| Project: | Calendar |
| Version: | 6.x-2.x-dev |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
I am using the date module coupled with the calendar module to give me a nice way to view a custom CCK Event nicely on a calendar.
I had modified the default calendar views to show my custom CCK event on the calendar views according to the events start date.
This was working all fine until I decided to make my events on the Calendar block more ambiguous.
By default the block was underlining a day number that had an event
so I just added another style to line 181 to make the color of the font red in calendar.css.
table .mini-day-on a {
text-decoration:underline;
<b>color: #FF2929;</b>
}This worked as the modules calendar block was a mini calendar but in the year page view the first
5 months of 2009 showed a underline and red text for every single day. (only 5 events are actually scheduled, all in may)
(as seen in attached picture)
Now, my latest scheduled 'event' for 2009 is on may 31st and that appears to be the last day that is being highlighted.
For testing I created a new event for Aug 7th, and now the calendar highlights everything up to that day.
Using firefox firebug shows me that every one of those days/table cells are given the class 'has-events' and 'mini-day-on'
when only days that have events should be getting these classes.
Im also trying to track the bug down myself, but any insight or fixes would be great.
Ryan
| Attachment | Size |
|---|---|
| oddview.jpg | 147.95 KB |

#1
If it's doing that, it's obviously a bug. I'm going to be working on Date and Calendar today so if I have time I'll try to track it down, but if you find anything yourself please post it to speed things up :)
#2
I am seeing a similar issue, but all of 2009 is getting underlined and up to June 8 of 2010.
I have not had the chance to dig into it any deeper yet, though. So I don't have any more details or information or steps to reproduce this issue.
#3
All I can find so far is where the mentioned classes are being appended to the table cells.
line 125 of calendar.inc
else {$content = calendar_build_day($curday, $view, $items);
$class .= ($curday_date == $today ? ' today' : '') .
($curday_date < $today ? ' past' : '') .
($curday_date > $today ? ' future' : '') .
(empty($items[$curday_date]) ? ' has-no-events' : ' has-events');
}
The has-events class is being appended incorrectly.
It also seems information is lost when switching to year when viewing the calendar in page view.
For example: (using the links year/month/week/day in a calendar page)
- i could look at the current month view,
- switch to week and see the current week,
- or day and view the current day.
After switching to year and get that odd view, the information seems to get lost so...
- switch back again to month it will show me Dec 2009,
- week will be some week in december,
- day will be todays day (4th) but in december.
I could see visually the links had changed hovering over them,
previously the arguments were 2009, 2009-05, 2009-W19, 2009-05-04
and after read 2009, 2009-12, 2009-W49, 2009-12-04
I am still new to drupal so Im somewhat limited as to what I can debug but hopefully this helps zero in on the bug.
#4
I am also seeing a similar issue - Only in year view, the block mini-calendar is fine
I can't add much except to say that the "has-events" class is applied to every day from todays date up until the last event that is in the calendar.
In my case today is the 11th & the last event I have in my calendar is 13th September 2009
I have applied a background color to "has-events"
I've attached screenshots of both the year view and the block which are displayed on the same page to try to illustrate in case it helps
Oh and I can confirm same behaviour as described in post above, from year view the top links always go to December (though are based on the correct date i.e. from today I get to the 11th December) - if you re-view the month view all comes back to where it should be, until you hit year again
#5
I am having the same issue.
#6
I also tried this solution for not linking days with no events:
http://drupal.org/node/439454
But I get a similar result - all days from the beginning of the year to the last day of my event are linked instead of just my event days.
See screenshot - I have a single event from June 1 to June 30.
All of the linked days have the 'has-events' class.
#7
Or, can anyone suggest another way to style days that have events vs empty days?
Thanks
#8
I have a similar issue; it looks fine in all views but the year view. Here two days before each event are underlined and have "has-event".
#9
Can anyone tell me if the same issue happens in the 2.0 version? If not, I'll just use that one - year view styling is essential for my project.
#10
Same issue here. Following.
#11
This problem does not occur in version 2.0. I'm going with that one for now.
#12
Same issue here using 6.x-2.1
Also found a duplicate #421578: Wrong underlining of date numbers in year displays
#13
I found a workaround for this bug: exclude your date field from display in the year view.
Works for me.
#14
Nice! That worked for me too. Thanks hugoline.
Still having the "information is lost when switching to year" issue commented on #3 http://drupal.org/node/451460#comment-1553092
#15
I was having this problem as well, but I think the latest version of date/calendar fix it.
At least I am not noticing the issue now.
#16
Automatically closed -- issue fixed for 2 weeks with no activity.