Monday, 29 February 2016

Office 365 & SharePoint - Hide Weekends on Calendar View

A - OBJECTIVE: at Calendar view, you wish to hide weekends (i.e. Sats & Suns)

B - PROBLEMS :

To leverage on default SharePoint features, we need to customise the CSS style sheet.

C - SOLUTION:

1. Go to Site Settings to change the Regional Settings so that Mons are the first days in the calendar view.

2. Embed a Content Editor webpart into the page so that it can host the below CSS style.

D - SOURCE CODE:

<style type="text/css"> 
    table.ms-acal-month > tbody > tr > td:nth-of-type(6) > div { 
        background-color:#ebebeb;
        position:relative;
        z-index:999; 
    } 
     
    table.ms-acal-month > tbody > tr > td:nth-of-type(7) > div { 
        background-color:#ebebeb;
        position:relative;
        z-index:999;
    } 
</style>