Customizing the calendar view of a list to show a date range with a name

Paula L 106 Reputation points
2021-09-23T23:06:39.543+00:00

I want to use the standard calendar view of a list to show an item with a date range--a campaign, for example, that runs for a month, or someone's vacation time off (just as an example so you have a visual). And then I want to be able to name that date range. What I've tried:

  1. Setting up start date and end date columns in the list, which doesn't result in a visual span across all the days of the campaign.
  2. Creating a new calendar view and, using a little bit of code, create part of what I'm looking for, which uses a calculated column that shows the diff between start and end dates and does end up with a bar across all those dates but has two problems: a) the bar shows the number of the diff between the dates (so, for example, it shows 30 rather than a name of a campaign--for example, something like "Fall Campaign). b) the new view looks nothing like the default calendar view. It looks like old Sharepoint and it is essentially uneditable. I.e., there is a ribbon along the top with a bunch of things to do, but none are "add new item". And it looks totally unlike the rest of our SharePoint apps. Ultimately I want to be able to update this calendar with items from another list, too. I've been able to use flows to do that kind of thing, so not looking for advice there (but just to explain why I'm not just using something like an Outlook calendar).

So what I want to do is be able to use something like that date diff code to create a bar that spans the date range and be able to name the campaign or event. Ideally, not needing to involve a developer (or with steps that a non-developer can follow).

Thanks in advance!

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

Accepted answer
  1. Paula L 106 Reputation points
    2021-09-27T15:37:23.6+00:00

    Thanks so much! I was with you up to step 4, but then you lost me. When you say "edit the calendar view" I'm assuming you mean in List Settings, vs. the dropdown Edit this view from the actual calendar. When I go to the Calendar View in List Settings the only part of your screenshot above that is actually available to me is the Name and Filters. Time Interval, Calendar Columns, and Default Scope are not in my Edit View options. Should I have started with a new calendar view vs. trying to work with the default one?

    Edit to say that I can recreate what you demonstrated with a separate calendar view, but it looks like the one in your picture, which does not look like the nicely formatted default calendar view. This is why I was hoping to hack the default calendar, which looks more like all the other SharePoint apps we're using. But this is progress, anyway!


1 additional answer

Sort by: Most helpful
  1. Echo Du_MSFT 17,316 Reputation points
    2021-09-24T02:44:17.373+00:00

    Hello @Paula L ,

    Welcome to Q&A Forum!

    Please following steps:

    1.This is my SharePoint list. [Days] is a Calculated column to calculate the time difference between [Start Date] and [End Date].

    134891-1.png

    2.Create a Calculated column named "Date Range"

    3.Use the below Formula:

    =[Title]&" | Days: "&[Days]  
    

    134863-2.png

    4.Create a Calendar view:List Settings >> ( View ) Create view

    135866-s1.jpg

    Then, change the "Month View Title" column to your new Calculated column.

    134795-3.png

    In classic mode:

    134864-calendar.gif

    Thanks,
    Echo Du

    ===============================

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    3 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.