Hide start time in FullCalendar

后端 未结 13 1634
灰色年华
灰色年华 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 21:55

    Although @Riz was correct at the time of posting, the css has changed in recent versions and now you'd need the following.

    .fc-day-grid-event .fc-time{
        display:none;
    }
    
    0 讨论(0)
  • 2021-02-06 22:00

    According to http://fullcalendar.io/docs/text/timeFormat/ , you just need to set time format in fullCalendar settings:

    $('#calendar').fullCalendar({
        events: [              
        ],
        timeFormat: ' '
    });
    
    0 讨论(0)
  • 2021-02-06 22:01

    Just add to calendar options

    displayEventTime: false
    
    0 讨论(0)
  • 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";
    
    0 讨论(0)
  • 2021-02-06 22:08

    remind that the CSS class name has changed to

    .fc-time {
        display:none;
    }
    
    0 讨论(0)
  • 2021-02-06 22:13

    The following hides the date on the month view only:

    .fc-view-month .fc-event-time{
        display : none;
    }
    
    0 讨论(0)
提交回复
热议问题