Color code your SharePoint calendar

A nice new feature in SharePoint 2010 is the ability to roll up multiple calendars into one, and color code them. In previous versions of SharePoint, this was something that was only doable with third-party products or some serious jQuery.

Consider the following scenario. The sales department of Contoso has a single calendar they use to track and manage their events, like trade shows, client meetings, follow up calls, department meetings, etc. They have it all in one calendar, but it’s a mess, and hard to see important events.

Boring SharePoint Calendar View

Instead, they would like to view each category of event in its own color. Like this:

Color coded SharePoint calendar

This is simple to do with a single calendar, there’s just a little leg work up front.

Before we begin: one down side to this is that it’s not easily replicable. Once you create your calendar, you cannot copy or move it to another location. You’ll need to recreate it again in your new location. So start with your calendar view or web part you want to use.

One more note: it has been discovered that once you’re using the calendar overlay, clicking on an event will open a new window to view the event. It will not use the modal dialog box. I’m betting this is a “feature” since the overlay could technically pull from calendars from other lists and sites. I’ll see if I can figure a way around that. ;)

To make this pretty calendar, we need to make a view for each color set we want. By making each view, we can overlay each view over the calendar and then select a color for each. Creating each view will require the filter data to be in the appointment in some manner. Ideally a choice field has been added with options to choose from, but if your users were typing in “Tradeshow” or “Meeting” in the Title field, we can filter on that as well.

First thing we do is modify the default view. Chances are your current default view is Calendar, which includes all items. This will be our base for our colorful masterpiece. This default view will automatically assume the green color. Go head and modify this view to weed out anything you don’t want using a unique color (i.e. set the filter where category is equal to blank, as long as the users specify a category it shouldn’t show up in this view).

Now create a view for each color set.

Quick steps to create a view

  • In the ribbon, click the Calendar tab, then click Create View
  • On the bottom half of the page, select existing view Calendar
  • Name it accordingly.
  • Scroll down to the Filter and specify your filter
  • Click OK

Continue these same steps to create each view. At the end, you should have a few views. Check out each view and ensure you’re seeing unique values in each. If you see the same value in more than one, it will appear more than once (in each color) in your color coded calendar.

Once your views are made, go to your site home page and browse to your calendar page. This will ensure we’re on the default page that your users will also access.

Now let’s bring it all together

  • In the ribbon, click the Calendar tab
  • Click Calendars Overlay
  • Click New Calendar
  • Name it, preferably the same name as your view
  • Select your color
  • Ensure the correct URL is specified and click Resolve
  • Select your Calendar list
  • Select your View
  • Check Always Show
  • Click OK

Do this for each view and then click OK to return.

Now you have a pretty color coded calendar! You’ll also see a legend on the left, which helps define the colors for your users.

Color code SharePoint legend

Don’t forget your missing appointments! Make sure your views are including all of your appointments. In my example, if the Category field isn’t required, users can create appointments without specifying a category. This would cause appointments to go missing in our new view. To resolve this, create another view which includes a filter to include all but the above items.

Want to change up the colors? Check out my other post: http://davidlozzi.com/2012/06/20/customize-the-sharepoint-calendar-colors/.

Happy SharePointing!

About these ads

69 thoughts on “Color code your SharePoint calendar

  1. Shailesh

    Hi Dev,

    Thank you for such a good resource, but what ever you had define that is only implement with Calendar list not with the calendar view.

    Regards
    Sk

    Reply
  2. Deb

    This is excellent! I was just at a training class and asked the instructor how to do this – no one knew. I have been losing my mind trying to figure this out! THANK YOU!

    Reply
  3. jimmy

    David, if I have the calendar added as a web part to the main page of my sharepoint site, can I still have all the colors show up as well? Thanks for the post, I was looking for a way to accomplish color coding without adding javascript or a custom web part.

    Reply
    1. David Lozzi Post author

      Yes, it is quite doable on a web part, follow the same steps. However, you will have to select the web part to get the ribbon to load the calendar options.

      Reply
      1. jimmy

        I was just being dumb and not setting up the view properly, it was using the default web view instead of “calendar” view I needed. One final question, is there a relatively simple way to customize colors in the overlay? I found one way of doing it so far through the CSS but apparently it breaks the site theme…

      2. David Lozzi Post author

        LOL. I don’t know about changing the colors. I will see what I can find out!

      3. Kristin

        I am having some trouble with this. I created the view in my calendar, but now I am trying to add it to a web part. Whenever I change the web part to the view that has the color coding – it goes back to “current view” after I hit apply and save and just a normal boring colored view shows up. Any suggestions?

      4. David Lozzi Post author

        Hi Kristin,

        This is default handling of the web parts, a web part view does not directly link to an existing view, instead it’ll copy the view and then treat the view as unique on the web part. Unfortunately, color coded calendars do not carry over to web parts, you’ll need to recreate each layer in the web part’s view.

        Let me know how it goes.

        David

  4. Billy Kirby

    Thanks for the tutorial – very helpful. A little further help would be appreciated though as I can’t quite figure out what I’m doing wrong!
    All the entries are duplicated, i.e. one with the colour coding and the origina, uncoded entry. Do you know what I’m doing wrong? It’s driving me crazy!

    Reply
  5. Billy Kirby

    I have figured out a solution; i.e. to add another column, giving it a default value and modifying the default view to exclude views without that value. Bit convoluted so if there is a cleaner solution you can recommend i’d be grateful!

    Reply
    1. David Lozzi Post author

      That’s correct, you need a field to filter the view by, otherwise there’s no way to know what events should be what color.

      Reply
      1. David Lozzi Post author

        Sure thing. Go to your list, and then click the List ribbon tab, and then click Create View in the ribbon. Select your desired view format, in case of color coding a calendar, select Calendar view. On the next page, configure your view. The piece that makes color coding work is the Filter. You’ll want to create a view per color, and each view should filter to fit your requirements. So create one view where Category is equal to Meeting, one where Category is equal to Holiday. Then you’ll have views to color code! Hope this helps.

    2. charlesincharge

      I’m finding that my default calendar is showing duplicates of everything, with each item in both the default color and the color I selected for one of the views (i.e. the same two colors for each item, rather than the default color and a different color depending on the category)

      Reply
      1. David Lozzi Post author

        This appears to be a recurring question, see previous comment from Billy Kirby: “I have figured out a solution; i.e. to add another column, giving it a default value and modifying the default view to exclude views without that value.”

  6. Pingback: Customize the SharePoint Calendar Colors | David Lozzi's Blog

  7. Pingback: Creating an item detail dashboard view of your joined lists in SharePoint 2010 | David Lozzi's Blog

  8. tony

    here’s an idea…. have a drop down in the interface when creating an event that shows different colors depending on their category….. wow! FAIL.

    Reply
    1. David Lozzi Post author

      Tony, nice idea. Using some basic javascript we could set the field which is defining the colors to highlight each row accordingly. However, do you want users picking values based on a color? Or the data? I’d lean toward data, will a user care what color is what when they’re adding their information? I don’t know.

      Reply
  9. Matt Richards

    Good post. We’re doing something similar and are frustrated at how the links to the appointments open in a new window. Did you ever figure out a work around for this?

    Reply
    1. David Lozzi Post author

      I got close. The wall I hit was that the links in the calendar are generated after the page loads, so my script runs too early. I couldn’t find a way to capture the later event and then update the links.

      Reply
      1. Matt Richards

        Thanks for your response David. From your description it sounds like it’s not possible to address this. That’s disappointing. I wonder how we get Microsoft to look at it… It feels really messy to us, and it’s bound to cause user confusion…

  10. ben graf

    Hi, i was referred to this blog and have been able to color code calendars based on your above description. However i am seeing duplicate items in my main calendar view… If i add an event in say ‘meetings’ i will get the correct color coded meeting, as well as the same event in the default calendar color. I’m wondering if i am just missing something here to correct this?

    Reply
    1. David Lozzi Post author

      Since the legend is there by default, this won’t be an easy task. I’d suggest using a content editor web part, and create your legend manually. Let me know if you need further instructions.

      Reply
  11. Anil

    Hi David, I created color coded calender with your instructions.But i have one small doubt, after creating color coded calender when i double click on any event it opens in a new window.But when we double click on normal calender we are getting display form.Can you please help me how to resolve this.I want to display the event details in a “Disply form” not in a new window.

    Reply
    1. David Lozzi Post author

      Hi Anil,

      This has been identified as a known issue, I spent some time figuring it out but it appears that the events on the calendar view are loaded after the page loads. There’s no easy method to attach to to wait for the events to load, then redirect their page opening. I’m still working on some ideas. I’ll let you know what I find. Thanks

      Reply
  12. Pingback: Calendar Overlays: Keeping events in the same window. | David Lozzi's Blog

  13. Tougwa Franklin

    Hello, Good day. Please I have a problem and will need your assistance. I am working on SharePoint 2013. I have created a Master Calendar and Sub Calendars. I can roll events from Sub Calendars to Master Calendar and from Master Calendar to Sub Calendars. When I create an event is a sub calendar and roll up to the Master Calendar, the event has the default blue color in the sub calendar and has the applied color (e.g red) in the Master Calendar. When an event is created in the Master Calendar and rolled to the sub calendar, it has the default blue color in the Master Calendar and the applied color in the sub calendar. But I want these events to have same color ( i.e applied color, say Red) in the sub calendar irrespective of whether it is created in the Master Calendar or a Sub Calendar. Briefly, all events in the sub calendars should have the same unique applied color, whether it was created in the master calendar or in the sub calendar.
    Thanks for reply
    Franklin

    Reply
      1. Tougwa Franklin

        Hi David!
        Thanks for your quick reply. I have gone through your different posts time and number but I have not been able to find a solution to my problem.
        Remember this Calendar is for non SP Professionals, so they will like to see the events in the required color once they add it to any of the calendars, be it Master Calendar or Sub Calendar. I have beating head and changing different views to no avail.
        For a clew, I guess the solution should be hovering around views and filtering, but I am not very sure.
        Will be glad to hear from you.

      2. David Lozzi Post author

        Ok, so on each page where you have the overlays, you can add your own CSS, per my other post, to override the colors. Therefore, you can say color 1 is red on one calendar, and color 2 is red on another, thereby keeping the calendars the same colors on each page.

      3. Tougwa Franklin

        Hi David!
        Good day. I wish to display multiple columns in an event list in SharePoint 2013 using the Content Query Webpart(CQWP). For now, just the title of the event is displayed in the webpart. I want the Date and Title of the events should be displayed on the CQWP
        I know I have to first of all export the CQWP then do some editing there, go to the SharePoint Designer and open the XSL file and do something there as well before importing it back. But I am stock on that .
        Please I need a step-by-step out-of-the-box solution to this problem.
        Thanks for your guide in advance.

  14. pradeep

    Hi David!
    How can we toggle between day,weeks,month in sharepoint calendar.
    I need to create 3 button to change the view.

    Reply
  15. Aril

    Wow, nice solution, helps a lot. I am working on multiple calendar combination from different source into SharePoint. And I found two 3rd party’s solution, — SharePointBoost Calendar Rollup webpart and Bamboosolution Calendar Plus. Well, David, did you try these before? which one is better? I notice the function is same…Do you have any suggestion?

    Reply
    1. David Lozzi Post author

      Unfortunately, I have not worked with other 3rd party solutions, but both names you mentioned are reputable sources. Make sure to test thoroughly in a staging environment to ensure you get the right product! Good luck!

      Reply
  16. Houston

    Hi David.
    Love the post. I have one issue though. If a user clicks on one of the Calendars listed under ‘Calendars in View,” the page refreshes with only the Default view but with everything color coded as the default calendar color. Though all of the events are there, I can see this being a huge headache for me as an IT support person. Many people are going o be confused.
    Is there any way to prevent this from occurring? I may be missing something as I’m very new to SP. Thanks

    Reply
  17. Joel

    This is part 1 of what I’m looking for, and is a little more simple than what I have implemented in many different calendars and overlaying on one shell calendar. Once the suggested calendar above is implemented with different colors for different categories can this calendar be shared with Outlook maintaining Events and their category colors?

    Reply
    1. David Lozzi Post author

      No, unfortunately Outlook won’t carry of the overlays. From what I can tell, the overlays are very superficial, and only care about the one page they were added to. Very selfish…

      Reply
  18. Majid

    hi David!
    i am working on sp 2013 env, its seems that the issues with “modal dialog box” JavaScript solution dose not work on SP 2013!

    Reply
  19. Kyle Swenson

    I have implemented this in SP2013, however when I add an item to the calendar after the filter is applied, i get a double entry. One in the color of the assigned filter, the second in the default calendar color which I cannot remove. any ideas?

    Reply
    1. David Lozzi Post author

      Hi Kyle,

      The base view, or your default view, needs to be filtered as well to exclude the values in your other view overlays. Generally, the default view could have a filter of where Category is blank, and the other views are your specific categories. Let me know if I can help.

      Reply
    2. Kyle Swenson

      Ignore me. In SP2013 you have to scroll down to a different section of the screen to effect the defauly view.

      Reply
  20. Stephen

    Hi,

    I tried this on SharePoint online 2013 and when creating a new calendar, the “list” & “list view” dropdowns are both blank. Any ideas what I’ve done wrong?

    Thanks!
    Stephen

    Reply
  21. stephenpryke

    Hi,

    I tried this on SharePoint online 2013 and when creating a new calendar, the “list” & “list view” dropdowns are both blank. Any ideas what I’ve done wrong?

    Thanks!
    Stephen

    Reply
    1. stephen

      Worked it out – the Web URL included a space. I replaced that with %20 and suddenly the dropdowns appeared. Works perfectly now!

      Reply
  22. Prajith

    Great solution! I have implemented and have created 5 calender with different colors. I have a small issue, when I click the individual calenders it open immediately. But if I click the calenders in view, the calender opens one by one with a delay 4,5 seconds. Is there any solution to open all the calenders together? Thank you for your help.

    Reply
  23. yvonne8927

    Hi David,
    do you happen to know a way to show the calendar in a workweek view?
    (Who wants to work on a saturday or sunday :-) )
    Kind rgds,
    Yvonne

    Reply
    1. David Lozzi Post author

      That would require some custom CSS/JS to hide just those columns, then update the other days of the week to span into the missing space. Not impossible, but on the complex side. I’ll add it to my list, not sure when I can bust it out though.

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s