none
Calendar View - sharepoint 2013

    Question

  • Hi all,

    Is it possible to only show working days within the calendar.  e.g. Monday through to Friday?

    I require it for a 'Company Calendar' I intend to replicate.

    Wednesday, February 13, 2013 3:18 PM

Answers

All replies

  • out of the box it is not possible to modify the scopes in an calendar

    /blog twttr @esjord

    Sunday, February 24, 2013 12:54 PM
  • OOTB there is no such setting, you need to customize it

    http://community.office365.com/en-us/forums/154/t/44549.aspx

    for customization you can try this code answered similar post on http://social.msdn.microsoft.com/forums/en-US/sharepointgeneralprevious/thread/5f2ce4c4-097c-4b0a-b384-93e743122514

    <script type="text/javascript">
    
    var oTables = document.getElementsByTagName("table");
    var oTDs = [];
    var count=oTables.length;
    for (i=0;i<count;i++)
    {
      if (oTables[i].className == "ms-acal-detail")
      {
        //alert(oTables[i].rows.length);
        for (j=0;j<oTables[i].rows.length;j++)
        {
         oTDs = oTables[i].rows[j].getElementsByTagName("td");
     oTables[i].rows[j].removeChild(oTDs[5]);
     oTables[i].rows[j].removeChild(oTDs[5]);
    
        }
      }
    }</script><style type="text/css">
    .ms-acal-outday {
     WIDTH: 20%
    }</style>



    Mark this post as answer if this resolves your issue.


    Everything about SQL Server | Experience inside SQL Server -Mohammad Nizamuddin

    • Marked as answer by superOWLS Friday, April 19, 2013 8:51 AM
    Sunday, February 24, 2013 1:47 PM
  • Kind of worked thanks

    The above script just decreases the width of both Sat and Sun

    cheers

    Friday, April 19, 2013 8:51 AM
  • The script above (referenced here) works for me but doesn't work with the Monthly calendar view.  Only the Weekly.  Anyone get it to work on the monthly view?

    <script type="text/javascript">
    
    var oTables = document.getElementsByTagName("table");
    var oTDs = [];
    var count=oTables.length;
    
    for (i=0;i<count;i++)
    {
      if (oTables[i].className == "ms-acal-detail")
      {
        //alert(oTables[i].rows.length);
        for (j=0;j<oTables[i].rows.length;j++)
        {
         oTDs = oTables[i].rows[j].getElementsByTagName("td");
    		 oTables[i].rows[j].removeChild(oTDs[5]);
    		 oTables[i].rows[j].removeChild(oTDs[5]);
    	    }
      }
    }
    </script>

    • Edited by determs Monday, November 25, 2013 7:13 PM
    Monday, November 25, 2013 7:13 PM
  • I was looking for a same solution and found the below blog useful:

    http://prakashrajan.blogspot.in/2010/12/remove-saturday-sunday-from-calendar.html

    I did customization by using JavaScript Timing Events to fulfill required my requirements.

    Add a CEWP to your page, under the calendar, and link it to the following script:

    For both in Calendar- Month View and Week View:

     $(document).ready(function(){
      
      var oTable = document.getElementsByTagName("table");
      if (oTable != null) {
      
      for (i = 0; i < oTable.length; i++)
      {
      var table = oTable.item(i);
      if (table.className == "ms-acal-month")
      {
      for (var c = 0; c < table.rows.length; c++)
      {
      if (table.rows[c].cells.length == 8)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[1].style.display = "none";
      table.rows[c].cells[7].style.display = "none";
      }
      else if (table.rows[c].cells.length == 7)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[6].style.display = "none";
      }
      else if (table.rows[c].cells.length == 6)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[5].style.display = "none";
      }
      else if (table.rows[c].cells.length == 2)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[1].style.display = "none";
            }
           }
          }
         }
        } 
      });
     //For month view
      function month(){
      
      var oTable = document.getElementsByTagName("table");
      if (oTable != null) {
      
      for (i = 0; i < oTable.length; i++)
      {
      var table = oTable.item(i);
      if (table.className == "ms-acal-month")
      {
      for (var c = 0; c < table.rows.length; c++)
      {
      if (table.rows[c].cells.length == 8)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[1].style.display = "none";
      table.rows[c].cells[7].style.display = "none";
      }
      else if (table.rows[c].cells.length == 7)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[6].style.display = "none";
      }
      else if (table.rows[c].cells.length == 6)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[5].style.display = "none";
      }
      else if (table.rows[c].cells.length == 2)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[1].style.display = "none";
      }
      
           }
          }
         }
        }
       }
       //For week view
       function week(){
      
      var oTable = document.getElementsByTagName("table");
      if (oTable != null) {
      
      for (i = 0; i < oTable.length; i++)
      {
      var table = oTable.item(i);
      if (table.className == "ms-acal-detail")
      {
      for (var c = 0; c < table.rows.length; c++)
      {
      if (table.rows[c].cells.length == 8)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[1].style.display = "none";
      table.rows[c].cells[7].style.display = "none";
      }
      else if (table.rows[c].cells.length == 7)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[6].style.display = "none";
      }
      else if (table.rows[c].cells.length == 6)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[5].style.display = "none";
      }
      else if (table.rows[c].cells.length == 2)
      {
      table.rows[c].cells[0].style.display = "none";
      table.rows[c].cells[1].style.display = "none";
      }
      
           }
          }
         }
        }
       }
      
       
       
      $( "#WPQ2_nav_prev_a" ).click(function() {
       month();
      })
      $( ".ms-picker-table" ).click(function() {
      month();
      })
      $( "#WPQ2_nav_next_a" ).click(function() {
      month();
      })
      setInterval(function () { month()}, -10000);
      setInterval(function () { month()}, -10000);
      setInterval(function () { week()}, -10000);
      
       </script>


    sharadpatil

    Thursday, November 20, 2014 12:11 PM