0

I have a SharePoint calendar on a site, the specifications is that it just displays the current day on a calendar however if a user clicks on a day the web part changes to the day view of the calendar. Is there a way to disable the calendar web part from changing views?

I thought it might be an onclick event that was firing however the <td> tags don't have any onclick functionality attached to them.

Regards ~Donald Dunlop

Conway Stern
  • 152
  • 2
  • 10

1 Answers1

2

The solution to this was to use JQuery to strip attributes from the Calendar days.

`$dates = $('.ms-acal-summary-dayrow > td');
 $dates.each(function(){
     $(this).removeAttr("evtid");
     $(this).removeAttr("date");
 });`

This prevents the day view opening when individual days are clicked however the views can still be changed in the ribbon at the top of the page and if a user navigates to the next or previous month these attributes are readded.

The easiest solution was to create a custom web part that was just an asp.NET calendar and add styling to it.

Regards ~Donald Dunlop

Conway Stern
  • 152
  • 2
  • 10