javascripthtmlcssfullcalendarfullcalendar-4

FullCalendar list view - how to hide "all-day"


I have a FullCalendar List view.

All of the entries in the view will always be "all day" events. Therefore I don't really need the "all-day" that appears in the left column. Is there a way to remove this from the list?

enter image description here

$(document).ready(

  function() {

    var calendarEl = document.getElementById('date_list');

    var calendar = new FullCalendar.Calendar(calendarEl, {
        plugins: [ 'list' ],
        defaultView: 'listThirtyDay',
        height: 'auto',
        views: {
            listThirtyDay: {
                type: 'list',
                duration: { days: 30 },
                buttonText: '30 days'
            },
            listDay: { buttonText: 'Day' },
            listWeek: { buttonText: 'Week' }
        },
        header: {
            left: 'prev,next',
            center: 'title',
            right: 'listDay,listWeek,listThirtyDay',
        },
        time: false,
        eventSources: [
            {
                url: $('.KeyDatesURL').val()
            }
        ]
    });
    calendar.render();      
  } 
);

Solution

  • If you inspect the rendered HTML elements using your browser's Developer Tools you'll see the time text in a List view is kept inside a HTML element with the class "fc-list-item-time".

    Therefore you can set a simple CSS rule to hide it:

    .fc-list-item-time {
      display:none;
    }
    

    Live demo: https://codepen.io/ADyson82/pen/GRJByop