通过选择日期或时间跨度创建FullCalendar事件

时间:2016-10-19 15:07:31

标签: javascript jquery fullcalendar

我需要允许用户选择日期/时间范围来创建新事件。我有一个代码,当点击一天时打开新事件,我可以选择日期和时间,但它只返回开始日期和时间。我不知道如何允许用户选择多个时间/日期范围,或者如何捕获结束日期/时间。

在我的fullCalendar定义中,我有:

    dayClick: function (date, allDay, jsEvent, view) {
                var startDate = date._d.toISOString();
                var dueDate = date._d.toISOString();
                startDate = (startDate.substr(5,2)-1)+'/'+startDate.substr(8,2)+'/'+startDate.substr(0,4)+' '+parseInt(startDate.substr(11,2))+':'+startDate.substr(14,2);
                dueDate = (dueDate.substr(5,2)-1)+'/'+dueDate.substr(8,2)+'/'+dueDate.substr(0,4)+' '+(parseInt(dueDate.substr(11,2))+1)+':'+dueDate.substr(14,2);

                //using alert() in place of my function call 
                //to open the actual event creation page
                alert(startDate+'\n'+endDate);
    },

有关如何允许多日期/时间跨度以及如何捕获结束日期/时间的任何想法?

0 个答案:

没有答案