我正在使用以下插件:FullCalendar.js,作者:[https://fullcalendar.io/][1]
我将其与 ajax 和 JSON 以及 API 结合使用。但是我想知道是否有可能获得一周中选定的一天,因为我想在那天是星期六时满足某些条件:
这可能吗?我一直在查看文档并发现了这一点:
https://fullcalendar.io/docs/mouse/dayClick/
但我不确定这是否正确?
最佳答案
根据您的评论,是的,您需要 dayClick()
来实现:
$('#calendar').fullCalendar({
dayClick: function(date, jsEvent, view) {
var day = date.day(); // number 0-6 with Sunday as 0 and Saturday as 6
alert(day);
}
});
工作示例:https://jsfiddle.net/afn7thme/
引用号。 https://fullcalendar.io/docs/mouse/dayClick/
有关所有 fullcalendar 点击事件的完整列表,请查看文档 https://fullcalendar.io/docs/mouse/ .
关于javascript - FullCalendar.io 获取一周中的选定日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43981521/