Recent

Calendar make all events All Day events

The SharePoint calendars have an ‘All Day’ field which when checked, hides the time selectors for the dates and makes the event an all day event.
Calendar-add-day-checked-16-1

These events show up at the top of the date in Calendar view and are recorded as an All Day event in list views.  I originally found this solution on the SharePoint Fonder blog and then edited it a little to also hide the All Day option.

Check All Day event option and hide the checkbox

Use the following instructions to make the All Day option checked on new event creation (which will hide the time selectors) and to hide the option from the new event form.

1. Go to a Calendar App, click on the Calendar tab and select the All Events view.
Calendar-add-day-checked-16-2

2.  On the All Events view, click on the new event option.
Calendar-add-day-checked-16-3

3.  The new event page should now open in the full page (not in a popup dialog), click on the Site Actions > Edit page option.
Calendar-add-day-checked-16-4

4.  Click on the Add a Web Part option.
Calendar-add-day-checked-16-5

5. Scroll down the Categories and find Media and Content, select Script Editor, click the Add button.
Move-Key-Filter-Top-16-3

6.  Hover over the Script Editor webpart, click on the dropdown arrow, select Edit Web Part.
Promoted-Links-Vertical-16-3

7.  Now a Edit Snippet option should appear, click it.
Promoted-Links-Vertical-16-4

8. Paste in the following script to the Script Editor webpart

//code.jquery.com/jquery-1.11.0.min.js

// We use spBodyOnLoad to avoid SharePoint conflicts
_spBodyOnLoadFunctionNames.push(“myCalendarFunction”);
function myCalendarFunction() {
//Checks All Day checkbox if not checked
if (!jQuery(‘span[title=”All Day Event”] > input’).attr(“checked”))
{
jQuery(‘span[title=”All Day Event”] > input’).click();
}
//Hides All Day check-box
jQuery(‘nobr:contains(“All Day Event”)’).closest(‘tr’).hide();
};

Calendar-add-day-checked-16-6

9. Click on the Stop Editing option in the ribbon to save the page.
Calendar-add-day-checked-16-7

Completed Example: Now whenever creating a new event on this calendar, the events will be created as All Day events.
Calendar-add-day-checked-16-8

About Nick Hurst (84 Articles)
SharePoint and Nintex developer who strives to find easy to deploy and maintain solutions for business problems.

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

%d bloggers like this: