4

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();      
  } 
);
ADyson
  • 57,178
  • 14
  • 51
  • 63
Martin Perrie
  • 398
  • 5
  • 16

2 Answers2

5

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

ADyson
  • 57,178
  • 14
  • 51
  • 63
3

You can use this:

allDaySlot: false

See this link here - https://fullcalendar.io/docs/allDaySlot

also you can refer this: How to remove allDay from view in fullcalender JS?

Abhishek Kulkarni
  • 1,747
  • 1
  • 6
  • 8
  • 2
    `allDay: false` only applies to TimeGrid views, but the question is showing a List view. Also, if it _was_ possible to remove the all-day from a List view, it would remove all of the events. OP only wants to remove the text "all-day", not the whole events! – ADyson Mar 20 '20 at 09:40