Hide start time in FullCalendar

后端 未结 13 1615
灰色年华
灰色年华 2021-02-06 21:32

On FullCalendar, in the month view, is there a way to hide an event\'s start time?

13条回答
  •  生来不讨喜
    2021-02-06 22:07

    To hide them all, the following should work

    $('#calendar').fullCalendar({
     displayEventTime : false
    });   
    

    But if you (like me) were trying to hide the time of a specific event, I found pretty clean way.

    Just create the following CSS class and refer to it in the event property "className":

    .hideCalendarTime > div > span.fc-time{
        display:none;
    }
    

    And your event should look something like this:

    var newEvent = new Object();
    newEvent.title = "Something";
    newEvent.start = new Date();
    newEvent.allDay = false;
    newEvent.className = "hideCalendarTime";
    

提交回复
热议问题