我正在使用jquery fullcalendar资源视图。我想把slotMinutes设置为50.
但是当我设置它时它不显示事件
及其给出的错误:
函数HorizontalPositionCache (getElement)
和行是:
t.left = function(i) {
return lefts[i] = lefts[i] === undefined ? e(i).position().left : lefts[i];
};
错误:TypeError: e(…).position(…)为空
有谁能帮我解决这个问题吗?
在文件fullcalendar.min.js编辑函数function timeOfDayCol(datetime)
在返回前放:
colCnt = Math。
函数将保持如下:
function timeOfDayCol(datetime) {
var hours = datetime.getHours();
var minutes = datetime.getMinutes();
var slotMinutes = opt('slotMinutes');
var slot, diff, minDiff, closestMinute;
// round minutes to closest minuteslot
for (var i = 0; i <= 60 / slotMinutes; i++) {
slot = i * slotMinutes;
diff = Math.abs(slot - minutes);
if (diff <= minDiff || i == 0) {
minDiff = diff;
closestMinute = slot;
}
if (closestMinute == 60) {
hours++;
closestMinute = 0;
}
}
minutes = closestMinute;
for (var i = 0; i < colCnt; i++) {
if (indexDate(i).getHours() == hours && indexDate(i).getMinutes() == minutes) {
return i;
}
}
// not in range, return max
colCnt = Math.floor( (24 * 60) / slotMinutes);
return colCnt;
}