I recently answered a question about removing Saturday & Sunday from a calendar view to save screen real estate. Whilst there maybe other ways involving CAML, I thought JavaScript would be quick and easy. It appeared to work quite well and so I thought I would share it here.
Essentially you need to add some javascript to your default.master...
This will change this calendar...
Into this...
Here is the script if you want to cut 'n' paste it...
<script>
var oTable = document.getElementById("CalViewTable1");
if (oTable != null)
{
oTable = oTable.rows[2].cells[0].firstChild;
for (var c=0; c<oTable.rows.length; c++)
{
if (oTable.rows[c].cells.length == 9)
{
oTable.rows[c].cells[0].style.display = "none";
oTable.rows[c].cells[1].style.display = "none";
oTable.rows[c].cells[2].style.display = "none";
oTable.rows[c].cells[8].style.display = "none";
}
else if (oTable.rows[c].cells.length == 7)
{
oTable.rows[c].cells[0].style.display = "none";
oTable.rows[c].cells[6].style.display = "none";
}
else if (oTable.rows[c].cells.length == 2)
{
oTable.rows[c].cells[0].style.display = "none";
oTable.rows[c].cells[1].style.display = "none";
}
}
}
</script>