简体   繁体   中英

FullCalendar end daily event

How can I know the first and last day of a daily event? For example, I have an event every day at 8am, from the 15-08-2018 until the 17-08-2018, when clicking on the event in the calendar, I want to know the date of the last day of the event, the 08-17-2018

Thanks a lot.

You can use the eventClick event for the clicking of the event then you access the event data inside that function.

For more info read: https://fullcalendar.io/docs/eventClick

 $(function() { $('#calendar').fullCalendar({ events: [ { "title": "Event 1", "start": "2018-08-10T08:00:00+08:00", "end": "2018-08-15T07:59:59+08:00", }, { "title": "Event 2", "start": "2018-08-20T08:00:00+08:00", "end": "2018-08-25T07:59:59+08:00", } ], eventClick: function(calEvent, jsEvent, view) { alert(calEvent.start); alert(calEvent.end); } }); });
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.min.js"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.min.css" rel="stylesheet"/> <div id="calendar"></div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM