最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Fullcalendar.js get events of the day on click - Stack Overflow

programmeradmin2浏览0评论

Fullcalendar.js get events of the day on click

Is it possible to get all events of the day I click on in the monthview and print them in any div element with Fullcalendar.js?

Here's my JSFiddle:

/

Fullcalendar.js get events of the day on click

Is it possible to get all events of the day I click on in the monthview and print them in any div element with Fullcalendar.js?

Here's my JSFiddle:

http://jsfiddle/alexchizhov/syf9ycbc/4/

Share Improve this question edited Mar 12, 2021 at 19:24 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Oct 1, 2014 at 21:39 Alex ChizhovAlex Chizhov 1791 gold badge4 silver badges17 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

You can always iterate over all events and find out which event is on selected day. Here is my function to do that:

function getEvents(date){
        all_events.forEach(function(entry) {
            if (entry['start'] == date.format()){
                alert(entry['title']);}
            else if (entry['start'] <= date.format() && entry['end'] >= date.format()){
                alert(entry['title']);}
         });

    }

You can see my DEMO.

If you click on date 2014-10-06 there will be 2 events that will shows up in alert. Click on date 2014-10-07 will alert only one event.

发布评论

评论列表(0)

  1. 暂无评论