jquery full calendar horizontal drag and select multiple days -
i have tried implement horizontal drag selection in jquery full calendar didn't success. day wise vertical selection possible more 1 day selection in single drag not working. guys if have solution please suggest.
below code full calender:
$.createfullcalendarwithcurrenttime = function (selectcallback, eventscallback, mouseovercallback, options, eventrendercallback, curtime) { calendar = $('#calendar').fullcalendar({ unselectauto: false, header: { left: 'prev', center: 'title', right: 'next' }, titleformat: { week: "mmmm dd{ - dd, yyyy}" }, // sep 7 - 13 2009 , defaultview: "agendaweek", // columnformat: { month: 'ddd', week: 'ddd d/m', day: 'dddd d/m' }, columnformat: { week: 'ddd d'}, eventbackgroundcolor: options && options["eventbackgroundcolor"] ? options["eventbackgroundcolor"] : "#ffeb00", eventbordercolor: "#ffeb00", eventtextcolor: options && options["eventtextcolor"] ? options["eventtextcolor"] : "#333333", axisformat: 'h(:mm) tt', aspectratio: 0.1, buttontext: { prev: '', next: '' }, selectable: (selectcallback != null && $.isfunction(selectcallback) ? true : false), selecthelper: true, editable: false, alldayslot: false, slotminutes: slotminute, mintime: mintimenew, maxtime: maxtimenew, firstday: 1, eventmouseover: mouseovercallback, viewdisplay: function () { // create slots table if not created }, select: selectcallback, events: eventscallback, eventrender: eventrendercallback }); return calendar; }; function slotbind(cells) { cells.click(slotclick) .mousedown(slotselectionmousedown); } function slotselectionmousedown(ev) { if (ev.which == 1 && opt('selectable')) { // ev.which==1 means left mouse button unselect(ev); var dates; hoverlistener.start(function (cell, origcell) { clearselection(); if (cell && cell.col == origcell.col && !cellisallday(cell)) { var d1 = celldate(origcell); var d2 = celldate(cell); dates = [ d1, addminutes(clonedate(d1), snapminutes), // calculate minutes depending on selection slot minutes d2, addminutes(clonedate(d2), snapminutes) ].sort(cmp); renderslotselection(dates[0], dates[3]); } else { dates = null; } }, ev); $(document).one('mouseup', function (ev) { hoverlistener.stop(); if (dates) { if (+dates[0] == +dates[1]) { reportdayclick(dates[0], false, ev); } reportselection(dates[0], dates[3], false, ev); } }); } }
Comments
Post a Comment