Fullcalendar.js通过点击获取当天的事件 [英] Fullcalendar.js get events of the day on click
问题描述
是否有可能在monthview中点击当天的所有事件并将其打印在任何 div
元素与 Fullcalendar.js
?
这是我的JSFiddle :
http://jsfiddle.net/您可以随时迭代所有事件并找出选定的事件天。这是我的功能: 你可以看到我的 DEMO 。 如果您点击日期2014-10-06,则会有2个事件显示在警报中。点击日期2014-10-07只会提醒一个事件。 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 Here's my JSFiddle: http://jsfiddle.net/alexchizhov/syf9ycbc/4/ You can always iterate over all events and find out which event is on selected day. Here is my function to do that: 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. 这篇关于Fullcalendar.js通过点击获取当天的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$ p $ 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']);}
});
$ b
div
element with Fullcalendar.js
?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']);}
});
}