Hi everyone! 🙂
Seeking volunteers and examples of any custom code for the following scenario:
How to hide or remove Saturday and Sunday from the Month layout of a List Calendar View in a modern SP site using the Modern CEWP.
This is what I was working with, but I am not having any success:
document.addEventListener(‘DOMContentLoaded’, function() {
// Function to hide Saturday and Sunday columns in the month view
function hideWeekends() {
// Select all calendar cells
var calendarCells = document.querySelectorAll(‘.ms-Grid-col’);
calendarCells.forEach(function(cell) {
// Check if the cell represents Saturday or Sunday
var day = cell.getAttribute(‘data-day’);
if (day === ‘Saturday’ || day === ‘Sunday’) {
cell.style.display = ‘none’;
}
});
}
// Run the function to hide weekends
hideWeekends();
});
Thanks,
Wayne