How can get start and end time on fullcalendar?

后端 未结 7 1313
日久生厌
日久生厌 2021-02-12 12:17

how can i get start and end time of visible days in fullcalendar?

I need it for use in another javascript instace. Is there some function like -

7条回答
  •  温柔的废话
    2021-02-12 12:41

    If you're looking for the visible start and end date, that would be the visStart and visEnd property of the view object in version 1:

    $('calender').fullCalendar('getView').visStart
    
    $('calender').fullCalendar('getView').visEnd
    

    and that would be intervalStart and intervalEnd in version 2:

    $('calender').fullCalendar('getView').intervalStart
    
    $('calender').fullCalendar('getView').intervalEnd
    

    If you're looking for the start and end date of the current week / month, that would be the start and end property of the current view object:

    $('calendar').fullCalendar('getView').start
    
    $('calendar').fullCalendar('getView').end
    

    Reference : Full Calendar documentation.

提交回复
热议问题