
In part I, we saw how to adjust the size of an empty SharePoint month calendar to fit in the right column of our home page. Now our next step is to display the events.
As you can expect, the default display will be too big for our tiny calendar. So here are two tricks to work around this issue.
Method 1: no title display
In SharePoint 2007, you can choose which column to display in the month view. So let’s create an additional column:
- name: “Display”
- required: yes
- default value: “*”

In the view settings, choose [Display] as month view title. The result: for each event, SharePoint will display a simple “*” that will fit into the day cell.
This works fine, but the user has to click on the item to actually see the event. This may be an issue, especially if several events happen on the same day.
Method 2: shrink the title
So another option is to keep the title and use some CSS magic. Here is the deal: a title will be displayed in small fonts by default (unreadable), but will get back to normal size when the user hovers over it (see the screenshot at the beginning of this post).
To achieve this we’ll just add a few rules to the CSS from part I:
<style type="text/css">
/* Tiny Calendar */
/* Christophe@PathToSharePoint.com */
/* Remove week blocks */
.ms-cal-weekempty {display:none;}
.ms-cal-week {display:none;}
.ms-cal-weekB {display:none;}
.ms-cal-weekB {display:none;}
/* Shrink cells */
.ms-cal-workitem2B {display:none;}
.ms-cal-noworkitem2B {display:none;}
.ms-cal-nodataBtm2 {display:none;}
.ms-cal-todayitem2B {display:none;}
.ms-cal-workitem {font-size:0px;}
.ms-cal-muworkitem {font-size:0px;}
.ms-cal-noworkitem {font-size:0px;}
.ms-cal-nodataMid {font-size:0px;}
.ms-cal-todayitem {font-size:0px;}
/* thin out header */
.ms-cal-nav {display:none;}
.ms-cal-nav-buttonsltr {display:none;}
.ms-cal-navheader {padding:0px;spacing:0px;}
.ms-calheader IMG {width:15px;}
/* Abbreviate weekdays */
.ms-cal-weekday {letter-spacing:6px; width:22px; overflow: hidden;}
/* events display */
.ms-cal-defaultbgcolor {padding:0;}
.ms-cal-defaultbgcolor a {font-size:3px;}
.ms-cal-monthitem a {font-size:3px;}
.ms-cal-monthitem a:hover {font-size:10px;}
</style>
This second method is more user-friendly, if your titles are not too long.
There are of course many variations around these two methods, here are for example some other text adjustments you can use:
http://www.w3schools.com/Css/css_text.asp
And remember: all of this was done using CSS only, no harm was done to the structure itself. The SharePoint calendar remains fully operational (recurring events, alerts, filters, etc.).

66 comments
Comments feed for this article
October 13, 2008 at 6:15 am
Dan
Cristophe!
You are simply on fire!
Your straightforward introductions, and bite-sized approach to introducing CEWP and CSS features are outstanding! I hope you quickly rise to the top of any peer rating for WSS resources!!!!
This particular feature on Calendar webpart is something that’s been bugging me since the V3 intro, (and now there is an astoundingly simple solution!) Well done!
-Dan
October 13, 2008 at 1:29 pm
Paul
Is there anyway an “Alt” like tag can be implemented? When someone hovers over the event, a message would appear rather than expanding the calendar cell size.
October 14, 2008 at 1:00 am
Christophe
With SharePoint 2007, we have lost this “Alt” behavior that was available on the 2003 version.
We could modify the HTML to insert the alt attribute, but then the solution would be heavier – not CSS only – and maybe not worth the effort.
Another option is to use positioning. As a test, try adding this line to my CSS:
.ms-cal-defaultbgcolorsel {position:absolute;}
If I can come up with a clean and cross-browser solution, I’ll publish it.
October 14, 2008 at 2:14 pm
Paul
Waht does that piece of code do? I’ve applied it and it doesn’t seem to do anything.
Another idea would be to display this in another webpart, but that may clutter things on the screen.
October 14, 2008 at 2:49 pm
Christophe
Paul, with the additional line, the text of an all day event will expand when you hover over it, without expanding the cell size. This is just an example of what can be done using positioning.
October 15, 2008 at 7:41 pm
Paul
Have you found any way to do this same behavior with other events, not just All Day ones? I’ve tried using all the calendar elements I could find, and no luck.
October 16, 2008 at 7:00 am
Christophe
For events with a start time, replace:
.ms-cal-monthitem a:hover {font-size:10px;}
with:
.ms-cal-monthitem a:hover {position:absolute;font-size:10px;}
There are many variations around this, but I have yet to find a clean cross-browser one. If you don’t like the expanding cells, the two lines of CSS I have provided in the comments are an alternate option.
October 17, 2008 at 3:43 pm
Greg O
Wow!! Some really innovative content you’ve got published here. Thanks for taking the time to share it with us mere mortals. I’ve learned a lot on this blog. Thanks again and keep up the great work!!
Greg O
October 19, 2008 at 10:34 am
C Steel
Very nice & cute trick! Thanx a lot man, worked really smoth.
October 23, 2008 at 3:55 pm
Delpfine
Christophe, this is great! I use the calendar web part for my team meetings because it shows all events, both recurring and individually set meetings.
Is there a way to alter the css to remove the weekends? I only need the weekdays for this particular calendar.
Thanks!
October 24, 2008 at 10:03 am
Christophe
Sorry Delpfine, I don’t see an easy way with CSS to remove the weekends. btw I assume your question is about week views. I wouldn’t remove the weekends in a month view.
Update [October 25]: I just published another approach to address the size issue, maybe it can help? See:
http://pathtosharepoint.wordpress.com/2008/10/25/expandcollapse-buttons-for-your-web-parts/
October 30, 2008 at 1:49 pm
Sean
Cristophe
This is Great. One question I have is if there are more than two events in a single day on a calendar the x More Items with expand button appears. Is there a way to shrink that as well?
Awesome stuff.
October 30, 2008 at 3:00 pm
Christophe
…
Thanks for the catch, Sean. Add these two lines and it should work:
.ms-cal-more NOBR {font-size:3px;}
.ms-cal-more:hover NOBR {font-size:10px;}
November 3, 2008 at 7:26 am
No assembly required « Path to SharePoint
[...] CSS The same principle applies to styles. An example on this blog: a tiny calendar. [...]
November 4, 2008 at 10:41 am
Sneak peek: colored calendar « Path to SharePoint
[...] [same day]: here is another test. I have combined the “HTML calculated column” with the tiny calendar style and the popup effect introduced in this post. The [...]
November 8, 2008 at 2:36 am
How to scale down the SharePoint Gantt view « Path to SharePoint
[...] can we change this to view 6 months or one year? Last month, I showed how to shrink a month calendar. Today’s the turn of the Gantt [...]
November 10, 2008 at 7:24 am
Sandilya Venkatesh
This is a phenomenal resource. Thank you!!
Have you done anything with the discussion forum web part?
Regards,
Sandy
November 10, 2008 at 7:31 am
Christophe
Thanks Sandy
If you have a specific question, issue or need related to discussion lists, feel free to send me an e-mail at Christophe@PathToSharePoint.com. Who knows? Maybe I have your answer in one of my drawers…
November 23, 2008 at 2:48 am
Live demo: holiday calendar « Path to SharePoint
[...] ingredients are already on this blog: – how to shrink the calendar month view – how to display HTML in a calendar view – how to include a hover [...]
December 13, 2008 at 4:51 am
Chris Howell
Hi,
Have found this site to be really good and helpful. I’m just wondering how this code for the small calendar can be implemented with this code to hide the Sat & Sun in the calendar:
http://blog.thekid.me.uk/archive/2008/03/31/remove-saturday-sunday-from-a-calendar-view-in-sharepoint.aspx
If I implement the code from the link I get some weird stuff with lots of space and vertical lines.
Thanks in advance.
Chris
December 13, 2008 at 10:11 am
Christophe
Chris, I tried the code in the page you linked to and it didn’t work. Then I read the comments section and saw that somebody (“CodePirate”) had already reported the issue.
December 15, 2008 at 5:11 am
Christophe
[Follow-up] I’ll publish this week a script to remove week-ends from the month view.
December 17, 2008 at 5:42 am
Calendar - Weekdays only « Path to SharePoint
[...] in October, a reader, “Delpfine“, posted the question on my blog. And last week, another reader, Chris Howell, pointed to a [...]
December 18, 2008 at 11:33 am
Dave
Hi Christophe
Is there a way to get a calendar item to link to a specific URL (if I have a URL column in my list) when you click on it instead of to the default view of the list item?
December 18, 2008 at 12:19 pm
Christophe
Dave: I’d say yes, but I haven’t tried yet. Off the top of my head, I can think of a couple ways to do this. Give me a couple weeks…
December 18, 2008 at 3:24 pm
Mike
Is there a way to make the calendar smaller in the same way that you make the gnatt view so much cleaner. (BTW – thank you for the gnatt code – it really made it much easier to view my project release dates!)
December 18, 2008 at 3:29 pm
Mike
nevermind…. I just scrolled up and saw the code!!!
January 23, 2009 at 5:00 am
Karen
Is this also the same code for WSS 2.0?
January 29, 2009 at 10:16 am
Robin
Thanks! This code works great!
- For better viewing of appointments with time I added that background-color is set to white and a border.
March 14, 2009 at 12:22 am
hari
i am using calander to list all the training dates. my problem is – if the traning goes for two days suppose march 21 and 22. the calander displays in both 21 and 22 column . sometime same user click on both day and register twice for same training.
so how do i display the registration information only on 21 ?
or is there any way to disable the link on 2nd date so that the dont get registration form when they click on 22?
Thanks
hari
March 16, 2009 at 9:53 am
Christophe
hari: you can change the display options of your calendar, and set begin and end to be the start date.
March 16, 2009 at 5:45 pm
hari
thanks christophe
March 16, 2009 at 6:09 pm
hari
Hi Christope
I am new to sharepoint. i have another problem now. when i set begin and end date to start date, it displays in one cloumn. however it lists two links in same column for same training . i just wanted to display only one link. How do i do that?
Hari
March 17, 2009 at 10:41 pm
hari
Hi Christophe
I was trying to solve this problem for long time. but i am still not able to do this. here is my problem
i have a need to hide TO EVERYTHING from the list form webpart toolbar items EXCEPT “Export Event” which i did through the javascript and content editor web part.
but the main problem is it hides the toolbar for everyone. what i need is-i want to hide /show the toolbar items according to USER ROLE. for example if the user is administrator i don’t wanna hide anything. how do i do THAT? if you could give me resources or code sample then that will be great.
thanks
Hari
March 19, 2009 at 6:08 am
Sujit
Hi Christohpe,
How can I display a SharePoint calendar on another sub-site or page within SharePoint? Eg: A master calendar & a slave calendar (which reads of the master calendar).
For eg: I have a calendar (in the calendar view on a site), now I want to display the contents of this calendar on another page (also as a calendar view with your shrink code).
I tried chaning the slave calendar link in the Advanced option section under Modify Shared webpart, making it point to the master calendar.
However if I add anything on the master calendar it does not show up on the slave calendar…?
Hope this makes sense.
Thanks,
Sujit.
March 20, 2009 at 10:00 am
Christophe
Sujit: could you precise what you tried in the advanced options? Feel free to send me more details by e-mail.
March 24, 2009 at 11:47 am
Sheena
Hi,
Amazing article.It really helped me. Thnx…!!
I need to display some other’s calender on my homepage. Can you please advice me on this?
March 24, 2009 at 1:52 pm
Christophe
Sheena, could you precise your need? Do you mean a calendar from another site?
March 24, 2009 at 11:44 pm
Sujit
Hi Christophe,
Thanks for your reply.
OK, here’s my scenario again -
Say I have two sites, Site A and Site B. I create a Calendar in Site A to record events, etc. Now how do I display the contents (events, etc. recorded) of the Calendar in Site A on Site B.
So, basically what I’m trying to do is display Site A’s Calendar in Site B as well (i.e. Site B’s calendar reads off Site A’s calendar). Is this possible?
Please let me know if I still don’t make any sense.
Thanks heaps.
Best regards,
Sujit.
March 27, 2009 at 3:45 pm
Laura
Sujit – did you figure out how to display calendar A on Calendar B’s site? I’m curious
March 28, 2009 at 4:09 am
Sujit
Not yet Laura.
Cheers,
Sujit
March 28, 2009 at 4:27 am
Christophe
Sujit, is your need “simply” to display A’s calendar in site B, or do you also need to merge A’s calendar with B’s calendar?
March 29, 2009 at 10:30 pm
Sujit
Christophe –
Basically B’s calendar should read the contents off A’s calendar.
For eg: If I book a new event in calendar A, then calendar B should show it too (i.e. calendar B is always synchronized with calendar A). However it should not be true the other way round… Calendar B should always be Read-Only and should be just used for viewing (calendar A’s contents).
Please let me know if anything is unclear.
Thanks mate!
March 30, 2009 at 12:21 am
Christophe
Well, you could use a workflow that automatically pushes the content from A to B.
But I don’t understand your purpose. If B just replicates A’s content, then why not display A directly?
March 30, 2009 at 1:51 am
Sujit
Hi Christophe -
It’s like say we have 2 sites, one for public viewing (Site1 – read only) & the other one say just for managers (Site2 – restricted access). No we would like to display Site2’s calendar on Site1.
So we want to expose ONLY the calendar of Site2 in a read-only mode on Site1 for public viewing.
Thanks.
April 1, 2009 at 11:47 am
Sheena
Heylosss Christophe …
I am sorry for replying late.
What i need is somewhat similar what sujit is talking bout. To be more precise, there is a site on who’s homepage i need to display some one else calendar. Say, for eg, ‘yours’ calendar on the homepage of that site, so that every1 can c ur calendar.
I hope this time I am bit clear…
April 21, 2009 at 4:39 pm
TeckniX
Thanks for providing this CSS for all of us to use – it’s always a pain to figure out what css needs to be modified in MOSS.
A quick change though, is that you have:
.ms-cal-defaultbgcolor {padding:0;}
When it should be:
.ms-cal-defaultbgcolor, .ms-cal-defaultbgcolorsel {padding:0;}
When an event is set to ‘full day’ the defaulbgcolorsel is used when the mouse is over. If the padding isn’t applied to it, then you get more padding than you want on mouse-over.
April 23, 2009 at 1:36 pm
William
Christophe,
regarding Paul’s post (October 15, 2008 at 7:41 pm) and your response
I find that adding this line of code helps greatly but when the event text enlarges when you hover over it, the cell doesnt change with it. Is it possible to do this.
My real problem is that without the
.ms-cal-monthitem a:hover {position:absolute;font-size:10px;}
line the event jumps all over the place and is hard to hover over and read.
with this line of code it is stable but unreadable as it appears over the rest of the calendar.
Any help would be appreciated.
*I have to say your site is amazing, the company I am working for dont see to have any manuals for SharePoint. So I have to just fumble my way around but it the last few weeks my life has been made much easier. Thank you for your effort.*
May 1, 2009 at 4:28 am
Christophe
Sorry William, I have no immediate answer (especially as different browsers show different behaviors).
@TeckniX: thanks for the suggestion!
May 1, 2009 at 4:40 am
Sujit
Hi Christophe,
Any updates on my calendar issue?
Many thanks,
Sujit.
May 1, 2009 at 5:18 am
Christophe
Sujit: I don’t have a clean solution yet.
If you are ok to display events as a list, see this post:
http://pathtosharepoint.wordpress.com/2009/03/23/display-a-list-in-another-site-contd/
If you want a calendar view, it may work too but I think you’ll have to do a few adjustments.
May 14, 2009 at 2:36 pm
Katie
Hi Christophe,
first to echo a thanks for your blog – the mini cal is great. The burning question that I have is: when the mini cal is part of a page layout, how do you avoid having to load the txt file in the CEWP every time you create a new page based on the page layout? I guess that this is due to the fact the CEWP only has relative links. Any thoughts? Thanks.
May 16, 2009 at 1:49 am
Christophe
Katie: here are a couple options if you need to reuse a script or style:
- save it in a separate text file, and link each CEWP to it.
- save the CEWP as Web Part template, then you can easily add it to new pages you create.
- include the script or style in the Master page of your site.
May 15, 2009 at 12:36 am
Sujit
Thanks heaps Christophe. I will check out the link.
Cheers,
Sujit.
May 18, 2009 at 11:59 am
Katie
Thanks for the suggestions Christophe. I am sure they work, but I am just not sure how. I understand and can do the first suggestion of course, but I am trying to avoid the manual intervention.
And may I ask how you save the CEWP as a template.??
I put the CEWP (with mini cal text file attached to it) on the Master page (at the bottom), but the mini cal on a separate page doesn’t transform into its beautiful self.
Cheers.
May 18, 2009 at 2:00 pm
ChuckLew
Thanks for weeding through all of that CSS, Christophe. After I popped that in to a CEWP, I wanted to get the links to forward to the actual list instead of opening in the same WebPart Zone. I played around with some JavaScript and came up with this.
function CalLinkForward(){
var aForward=document.getElementsByTagName(‘a’);
for(var i=0;i<aForward.length;i++){
if (aForward[i].href.match(/javascript:MoveToViewDate\(\’([^\\]+)\\u002f([^\\]+)\\u002f([^']+)\’,\’Day\’\);/)) {
var scan = /javascript:MoveToViewDate\(\’([^\\]+)\\u002f([^\\]+)\\u002f([^']+)\’,\’Day\’\);/;
var getDates = aForward[i].href;
var result = getDates.match(scan);
var returnedDate = result[1] +’/'+ result[2] +’/'+ result[3];
aForward[i].href = ‘Lists\/Calendar\/calendar.aspx?CalendarDate=’ + returnedDate + ‘&CalendarPeriod=Day’;
//aForward[i].parentNode.parentNode.onclick = function(){window.location=’Lists\/Calendar\/calendar.aspx?CalendarDate=’ + returnedDate + ‘&CalendarPeriod=Day’;};
//The above commented line was an attempt to change the onclick even of the TD tags. It really should work like I’ve written it, but it doesn’t. Believe me I tried http://codingforums.com/showthread.php?t=166040. Until someone can solve that issue, I am simply turning the onclick events off with the line below.
aForward[i].parentNode.parentNode.onclick = ”;
}
}
}
It’s not perfect (see commented lines), but it does the job. I though tI would post it here, and see if you or anyone else could take it the rest of the way. Thanks again for this useful solution.
May 18, 2009 at 2:08 pm
ChuckLew
Oh, and you need to remember to call the function with a line like the following:
_spBodyOnLoadFunctionNames.push(“CalLinkForward”);
July 14, 2009 at 3:24 pm
Michelle
Christophe – WOW is my team happy!!! WOOOTNESSSSSS!!!!
.
Thank you again! Your name will live on in the code
July 27, 2009 at 2:16 pm
An experiment: tiny calendar + jQuery zoom « Path to SharePoint
[...] a previous post, I proposed two ways to deal with this issue, one being to include a zooming effect on the [...]
July 27, 2009 at 3:08 pm
Chris
Many thanks for this – one issue, and it isn’t with you CSS, but is common to the OUt of the Box CSS is that is breaks when used in “Black Band Master” – or in our case a master page derived from it.
Or rather it does in IE7 – FireFox is fine – The days with events have the base line shifted over a few px – I’m sure with investigating I can sort it, but if you’ve already got a fix it would be great.
I’m amazed MS don’t test their CSS in the other Master pages – I had similar issues with gantt charts.
Cheers
Chris
October 7, 2009 at 6:25 am
BoiseGuy
Amazing!!! You’re EasyTabs and Calendar magic have helped me tremendously – plus being able to use your css code to learn what can be done further. Mucho thanks and I hope to meet you one day and buy you the beverage, that I can afford, of your choice. I’m hoping to put the money together for the EUSP Accordian/EasyTabs workshop. Keep up the excellen work!
October 14, 2009 at 3:56 pm
Kris
Thanks for your reply! Ok so I got the calendar loaded and it is working.
Here is a question as well: what if I just wanted the ‘dates’ showing on a calendar and then I click the date and it only pulls up events happening on that date or available until that date?
Like on the outlook version calendar is what I hope to make eventually now!
November 12, 2009 at 4:36 pm
Amit
Hi,
is there any way to display the tool tip in sharepoint default calendar? Like once the mouse over on any event the title should display in the tool tip?
Thanks
Amit
November 13, 2009 at 8:08 am
Christophe
There are various ways to add tooltips to SharePoint calendars. Here is a screenshot using the jQuery Beauty Tips plugin (the live demo has been removed):
http://pathtosharepoint.wordpress.com/2009/09/04/a-workshop-calendar-loaded-with-demos/
Paul Grenier at endusersharepoint.com also has an interesting loadtip.
November 27, 2009 at 6:23 am
Singh Siddhu
Thx a lot Christophe. Your contributions have helped me immensely in improving my WSS.
December 1, 2009 at 2:48 pm
Anonymous
This code is absolutely AMAZING!
Thank you..I needed a mini-calndar for the sharepoint site.
Five stars!!!!!