Show Start and End time on a SharePoint calendar

If you have ever wondered if  it would be hard to show both the start and end times on a SharePoint calendar, stop wondering!

This can be performed in six simple steps.

  1. Create a calculated column.  Name the column “Time of Event”
  2. Insert this formula: =TEXT([Start Time],”h:mm AM/PM”)&” – “&TEXT([End Time],”h:mm AM/PM”)&” : “&Title
  3. For data type, select “Date and Time”
  4. For date and time format, select “Date and Time”
  5. Click OK
  6. Modify Calendar View:  Change monthly view title under calendar columns to “Time of Event”

The new entry will look similar to the image below:

21 Replies to “Show Start and End time on a SharePoint calendar”

  1. I tried your formula in Sharepoint 2010 Foundation and I get a syntax error

    The formula contains a syntax error or is not supported. at Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateField(String bstrUrl, String bstrListName, String bstrXML)
    at Microsoft.SharePoint.Library.SPRequest.UpdateField(String bstrUrl, String bstrListName, String bstrXML)

    I’m new to Sharepoint so any help would be greatly appreciated, I hear that there are some changes with 2007 and 2010 and I’m wondering if this is another.

  2. Currently we are still running MOSS. I am going to install 2010 soon and this will be one of the things that will have to be tested. As for this not working, I’m not sure why. All that this does is look at the two date columns and perform a calculation. Are you using the formula exactly the same way as I have written it? It’s possible that one of the column names on your site may be different.

  3. Thanks for the response Eric,

    Your solution in fact does work in 2010. After following your steps I restarted my IIS server and the end times are displaying correctly on my sharepoint calendar.

    Thanks again!

  4. This is my work-around, in case anyone else might find it useful. It displays like yours without your start time. It uses the word “to” to connect the built in start time with the formula end time you created. It will displays the start time, end time, room reserved and room number; the latter 3 choice columns. EX: “1:15 PM to 2:15 PM Computer Lab #2”. There are two formula columns and a number column used here.

    1. Create one number column for the room number.

    2. Create one calculated column titled Event Time and use this formula: =TEXT([End Time],”h:mm AM/PM”).

    3. Create another calculated column titled Summary and use this formula: =”to “&[Event Time]&” “&Reservation&” #”&Number.

    4. In the Calendar view select the following columns to display under “Calendar Columns”. Month View Title = Summary, Week View Title = Summary, Day View Title = Summary, leave the rest the default choices.

  5. If you cut and paste from this page you need to replace each of the quotes with regular double quotes. The quotes on this page are converted to wrong quote character.
    Thanks for the great tip, worked fine for me.

  6. Eric, have you found a way for the all day event or multiple day event to display properly? On my calendar, it shows only the end time, no start time.

  7. Hey Beth….For all day events, we have just been booking the time from like 8:00am to 5:00pm. For multiple days, say Monday thru Wednesday, we will book the start date/time for Monday at 8:00am and the end date/time from Wednesday at 5:00pm. This will give the appearance of an all day event booked for the three days.

  8. I can get Eric’s to work, but my client would love not to see the repeated start time. I cannot get Beth’s method to work – get a syntax error on the 2nd calculation column.

  9. Trudy…I could not get the default SharePoint start time not to show. This can probably be accomplished through code but for us, no one seems to mind. We have around 8,000 users on our network and I think that it only bothered me that the duplicate time was showing.

  10. Has anybody noticed that if it’s an All Day Event it displays 06:00 PM – 05:59 PM instead of the 12:00 AM – 11:59 PM? I know Eric suggested adding 8:00 – 5:00 and that’s a good workaround, but I have two schedulers and five confernce rooms. It would be awesome if we could tweak the formula. I tried changing the time format to hh:mm vice the orginal h:mm, no joy.

  11. Tracy…It’s not possible out of the box. Unfortunately, that’s how Microsoft designed it. I worked on this same issue for weeks and just finally gave up. What exactly are you trying to accomplish?

  12. Major problem with that solution and any solution that does date-time calculations in SharePoint.

    When SharePoint stores a date/time value, it first passes the value through some type of Time Zone filter which adjusts it to the equivalent value in UTC. When it goes to display a date/time, it passes back through the filter and you see it based on your time settings no matter where you are in the world. Cool!

    But all calculations in the “Calculated Columns” are made based on that UTC value without using any such filter and once the calculation is made, it has to store it. So, it happily passes it through the filter to convert the value that is already using UTC into what it thinks should be the UTC equivalent. This is why Tracy noticed that oddity. She was either in CST or MDT when she ran her calculations.

    OOOOOPS! Bad programming by Microsoft.

    So, what I want to know is this:

    Has anybody come up with an adaptable formula to overcome this monstrosity of an oversight?

  13. On my calendar all day events show as starting at 8:00 PM. So, my workaround that works is to format the column as “Single line of text”. Then use this formula:

    =IF(TEXT([Start Time],”h:mm AM/PM”)=”8:00 PM”,”All Day Event”&” : “&Title,TEXT([Start Time],”h:mm AM/PM”)&” – “&TEXT([End Time],”h:mm AM/PM”)&” : “&Title)

    If your all day events start at 6:00 PM. Then substitute 6:00 PM for 8:00 PM.

  14. I’ve been trying to find this solution forever! I wanted a single column to just show Start Time – End Time without dates (i.e. 7:00 AM – 6:00 PM)

    I just tried this out and it works perfect!

    I got the syntax error on the first try at creating the calculated column- thanks for the pointer to modify the double quotes. SharePoint didn’t like the fancy quotes, so the 2nd time around I copied & pasted the formula to SP, then deleted and re-typed each of the double quotes. It worked like a charm!

    Thansk so much for the help! I am very excited 🙂

  15. I had a similar request by an admin who maintains a calendar with reservations for three different lobby locations.

    1. I created a radio button choice column, labeled “Lobby,” (the event’s location, which you’ll see below.)

    2. The real magic that addresses the UTC glitch:

    Create a calculated column, titled “AllDay”. The formula:

    =IF(NOT([End Time]=[Start Time]),IF(MOD(ROUNDUP(([End Time]-[Start Time])*24,0),24)=0,TRUE,FALSE),FALSE)

    Configure the column so the Data Type returned from this formula is: Yes/No. (You can turn off the visibility of this field in the form used to create new events).

    3. Create another calculated column for “Calendar Display” or something similar. The formula is an if/else statement (remember to watch the double quotes!):

    =IF(AllDay,Title&” “&Lobby&” all day”,(Title&” “&Lobby&” until “&TEXT([End Time],”h:mm AM/PM”)))

    When you put this all together, all day events are displayed as just that, such as on Sept. 3 in the US:

    Labor Day – all day

    4. I couldn’t get rid of the start time either. The “else” statement for non all-day events is:

    Start Time
    + Title
    + Lobby
    + End Time

    An event in the Weinberg lobby that runs from 2-9pm, titled “Dr Sardi Patient Reception POC: Sarah Fawcett Lee” displays on the calendar as (I forced the line wraps for this post):

    2:00 PM
    Dr Sardi Patient Reception POC: Sarah Fawcett Lee
    in Weinberg
    until 9:00 PM

  16. I was trying Beth’s solution and keep getting “The formula refers to a column that does not exist.”. I am new to Sharepoint websites so it is all a learning experience for me. I researched that error but it doesn’t make any sense to me. Has anyone else seen this with the calculated fields? Thank you.

  17. To remove the default start time simply
    1. Open your calendar view page (calendar.aspx) in SharePoint designer.
    2. Switch to code view—in advanced mode
    3. Find the following code (near the bottom of the code—line 100+):

    .ms-bodyareaframe {
    padding: 0px;
    }

    4. Add following code under above code:
    .ms-cal-monthitem b{
    display:none;
    }

    After saving the change, you will find the default time is gone.

Leave a Reply