made things more jslint-friendly (semicolons, operators, etc)
This commit is contained in:
parent
deed716b67
commit
226536478b
|
@ -191,9 +191,9 @@ function Agenda(element, options, methods) {
|
||||||
for (i=0; d < maxd; i++) {
|
for (i=0; d < maxd; i++) {
|
||||||
minutes = d.getMinutes();
|
minutes = d.getMinutes();
|
||||||
s += "<tr class='" +
|
s += "<tr class='" +
|
||||||
(i==0 ? 'fc-first' : (minutes==0 ? '' : 'fc-minor')) +
|
(!i ? 'fc-first' : (!minutes ? '' : 'fc-minor')) +
|
||||||
"'><th class='fc-axis fc-leftmost " + tm + "-state-default'>" +
|
"'><th class='fc-axis fc-leftmost " + tm + "-state-default'>" +
|
||||||
((!slotNormal || minutes==0) ? formatDate(d, options.axisFormat) : ' ') +
|
((!slotNormal || !minutes) ? formatDate(d, options.axisFormat) : ' ') +
|
||||||
"</th><td class='fc-slot" + i + ' ' +
|
"</th><td class='fc-slot" + i + ' ' +
|
||||||
tm + "-state-default'><div style='position:relative'> </div></td></tr>";
|
tm + "-state-default'><div style='position:relative'> </div></td></tr>";
|
||||||
addMinutes(d, options.slotMinutes);
|
addMinutes(d, options.slotMinutes);
|
||||||
|
@ -216,7 +216,7 @@ function Agenda(element, options, methods) {
|
||||||
s += "<td class='fc-" +
|
s += "<td class='fc-" +
|
||||||
dayIDs[d.getDay()] + ' ' + // needs to be first
|
dayIDs[d.getDay()] + ' ' + // needs to be first
|
||||||
tm + '-state-default ' +
|
tm + '-state-default ' +
|
||||||
(i==0 ? 'fc-leftmost ' : '') +
|
(!i ? 'fc-leftmost ' : '') +
|
||||||
(+d == +today ? tm + '-state-highlight fc-today' : 'fc-not-today') +
|
(+d == +today ? tm + '-state-highlight fc-today' : 'fc-not-today') +
|
||||||
"'><div class='fc-day-content'><div> </div></div></td>";
|
"'><div class='fc-day-content'><div> </div></div></td>";
|
||||||
addDays(d, dis);
|
addDays(d, dis);
|
||||||
|
@ -264,7 +264,7 @@ function Agenda(element, options, methods) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
function resetScroll() {
|
function resetScroll() {
|
||||||
|
@ -447,7 +447,7 @@ function Agenda(element, options, methods) {
|
||||||
axisWidth,
|
axisWidth,
|
||||||
viewWidth,
|
viewWidth,
|
||||||
function() {
|
function() {
|
||||||
return head.find('tr.fc-all-day')
|
return head.find('tr.fc-all-day');
|
||||||
},
|
},
|
||||||
function(dayOfWeek) {
|
function(dayOfWeek) {
|
||||||
return axisWidth + colContentPositions.left(day2col(dayOfWeek));
|
return axisWidth + colContentPositions.left(day2col(dayOfWeek));
|
||||||
|
@ -533,7 +533,7 @@ function Agenda(element, options, methods) {
|
||||||
"<span class='fc-event-time'>" + htmlEscape(formatDates(event.start, event.end, view.option('timeFormat'))) + "</span>" +
|
"<span class='fc-event-time'>" + htmlEscape(formatDates(event.start, event.end, view.option('timeFormat'))) + "</span>" +
|
||||||
"<span class='fc-event-title'>" + htmlEscape(event.title) + "</span>" +
|
"<span class='fc-event-title'>" + htmlEscape(event.title) + "</span>" +
|
||||||
"</a>" +
|
"</a>" +
|
||||||
((event.editable || event.editable == undefined && options.editable) && !options.disableResizing && $.fn.resizable ?
|
((event.editable || event.editable === undefined && options.editable) && !options.disableResizing && $.fn.resizable ?
|
||||||
"<div class='ui-resizable-handle ui-resizable-s'>=</div>"
|
"<div class='ui-resizable-handle ui-resizable-s'>=</div>"
|
||||||
: '') +
|
: '') +
|
||||||
"</div>";
|
"</div>";
|
||||||
|
@ -577,9 +577,9 @@ function Agenda(element, options, methods) {
|
||||||
seg = segs[i];
|
seg = segs[i];
|
||||||
if (eventElement = seg.element) {
|
if (eventElement = seg.element) {
|
||||||
val = vsideCache[key = seg.key = cssKey(eventElement[0])];
|
val = vsideCache[key = seg.key = cssKey(eventElement[0])];
|
||||||
seg.vsides = val == undefined ? (vsideCache[key] = vsides(eventElement[0], true)) : val;
|
seg.vsides = val === undefined ? (vsideCache[key] = vsides(eventElement[0], true)) : val;
|
||||||
val = hsideCache[key];
|
val = hsideCache[key];
|
||||||
seg.hsides = val == undefined ? (hsideCache[key] = hsides(eventElement[0], true)) : val;
|
seg.hsides = val === undefined ? (hsideCache[key] = hsides(eventElement[0], true)) : val;
|
||||||
titleSpan = eventElement.find('span.fc-event-title');
|
titleSpan = eventElement.find('span.fc-event-title');
|
||||||
if (titleSpan.length) {
|
if (titleSpan.length) {
|
||||||
seg.titleTop = titleSpan[0].offsetTop;
|
seg.titleTop = titleSpan[0].offsetTop;
|
||||||
|
@ -594,7 +594,7 @@ function Agenda(element, options, methods) {
|
||||||
eventElement[0].style.width = seg.outerWidth - seg.hsides + 'px';
|
eventElement[0].style.width = seg.outerWidth - seg.hsides + 'px';
|
||||||
eventElement[0].style.height = (height = seg.outerHeight - seg.vsides) + 'px';
|
eventElement[0].style.height = (height = seg.outerHeight - seg.vsides) + 'px';
|
||||||
event = seg.event;
|
event = seg.event;
|
||||||
if (seg.titleTop != undefined && height - seg.titleTop < 10) {
|
if (seg.titleTop !== undefined && height - seg.titleTop < 10) {
|
||||||
// not enough room for title, put it in the time header
|
// not enough room for title, put it in the time header
|
||||||
eventElement.find('span.fc-event-time')
|
eventElement.find('span.fc-event-time')
|
||||||
.text(formatDate(event.start, view.option('timeFormat')) + ' - ' + event.title);
|
.text(formatDate(event.start, view.option('timeFormat')) + ' - ' + event.title);
|
||||||
|
@ -631,7 +631,7 @@ function Agenda(element, options, methods) {
|
||||||
|
|
||||||
function bindDaySegHandlers(event, eventElement, seg) {
|
function bindDaySegHandlers(event, eventElement, seg) {
|
||||||
view.eventElementHandlers(event, eventElement);
|
view.eventElementHandlers(event, eventElement);
|
||||||
if (event.editable || event.editable == undefined && options.editable) {
|
if (event.editable || event.editable === undefined && options.editable) {
|
||||||
draggableDayEvent(event, eventElement, seg.isStart);
|
draggableDayEvent(event, eventElement, seg.isStart);
|
||||||
if (seg.isEnd) {
|
if (seg.isEnd) {
|
||||||
view.resizableDayEvent(event, eventElement, colWidth);
|
view.resizableDayEvent(event, eventElement, colWidth);
|
||||||
|
@ -643,7 +643,7 @@ function Agenda(element, options, methods) {
|
||||||
|
|
||||||
function bindSlotSegHandlers(event, eventElement, seg) {
|
function bindSlotSegHandlers(event, eventElement, seg) {
|
||||||
view.eventElementHandlers(event, eventElement);
|
view.eventElementHandlers(event, eventElement);
|
||||||
if (event.editable || event.editable == undefined && options.editable) {
|
if (event.editable || event.editable === undefined && options.editable) {
|
||||||
var timeElement = eventElement.find('span.fc-event-time');
|
var timeElement = eventElement.find('span.fc-event-time');
|
||||||
draggableSlotEvent(event, eventElement, timeElement);
|
draggableSlotEvent(event, eventElement, timeElement);
|
||||||
if (seg.isEnd) {
|
if (seg.isEnd) {
|
||||||
|
@ -936,7 +936,7 @@ function Agenda(element, options, methods) {
|
||||||
minutes = time.getHours()*60 + time.getMinutes() - minMinute,
|
minutes = time.getHours()*60 + time.getMinutes() - minMinute,
|
||||||
slotI = Math.floor(minutes / slotMinutes),
|
slotI = Math.floor(minutes / slotMinutes),
|
||||||
slotTop = slotTopCache[slotI];
|
slotTop = slotTopCache[slotI];
|
||||||
if (slotTop == undefined) {
|
if (slotTop === undefined) {
|
||||||
slotTop = slotTopCache[slotI] = body.find('tr:eq(' + slotI + ') td div')[0].offsetTop;
|
slotTop = slotTopCache[slotI] = body.find('tr:eq(' + slotI + ') td div')[0].offsetTop;
|
||||||
}
|
}
|
||||||
return Math.max(0, Math.round(
|
return Math.max(0, Math.round(
|
||||||
|
|
20
src/grid.js
20
src/grid.js
|
@ -47,7 +47,7 @@ views.month = function(element, options) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
views.basicWeek = function(element, options) {
|
views.basicWeek = function(element, options) {
|
||||||
return new Grid(element, options, {
|
return new Grid(element, options, {
|
||||||
|
@ -99,7 +99,7 @@ views.basicDay = function(element, options) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
// rendering bugs
|
// rendering bugs
|
||||||
|
@ -119,7 +119,7 @@ function Grid(element, options, methods) {
|
||||||
cachedEvents=[],
|
cachedEvents=[],
|
||||||
segmentContainer,
|
segmentContainer,
|
||||||
dayContentPositions = new HorizontalPositionCache(function(dayOfWeek) {
|
dayContentPositions = new HorizontalPositionCache(function(dayOfWeek) {
|
||||||
return tbody.find('td:eq(' + ((dayOfWeek - Math.max(firstDay,nwe)+colCnt) % colCnt) + ') div div')
|
return tbody.find('td:eq(' + ((dayOfWeek - Math.max(firstDay,nwe)+colCnt) % colCnt) + ') div div');
|
||||||
}),
|
}),
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ function Grid(element, options, methods) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
function dayClick(ev) {
|
function dayClick(ev) {
|
||||||
|
@ -323,7 +323,7 @@ function Grid(element, options, methods) {
|
||||||
rowHeight1 = Math.floor(tbodyHeight / rowCnt);
|
rowHeight1 = Math.floor(tbodyHeight / rowCnt);
|
||||||
rowHeight2 = tbodyHeight - rowHeight1*(rowCnt-1);
|
rowHeight2 = tbodyHeight - rowHeight1*(rowCnt-1);
|
||||||
}
|
}
|
||||||
if (tdHeightBug == undefined) {
|
if (tdHeightBug === undefined) {
|
||||||
// bug in firefox where cell height includes padding
|
// bug in firefox where cell height includes padding
|
||||||
var tr = tbody.find('tr:first'),
|
var tr = tbody.find('tr:first'),
|
||||||
td = tr.find('td:first');
|
td = tr.find('td:first');
|
||||||
|
@ -431,7 +431,7 @@ function Grid(element, options, methods) {
|
||||||
|
|
||||||
function bindSegHandlers(event, eventElement, seg) {
|
function bindSegHandlers(event, eventElement, seg) {
|
||||||
view.eventElementHandlers(event, eventElement);
|
view.eventElementHandlers(event, eventElement);
|
||||||
if (event.editable || event.editable == undefined && options.editable) {
|
if (event.editable || event.editable === undefined && options.editable) {
|
||||||
draggableEvent(event, eventElement);
|
draggableEvent(event, eventElement);
|
||||||
if (seg.isEnd) {
|
if (seg.isEnd) {
|
||||||
view.resizableDayEvent(event, eventElement, colWidth);
|
view.resizableDayEvent(event, eventElement, colWidth);
|
||||||
|
@ -500,7 +500,7 @@ function Grid(element, options, methods) {
|
||||||
|
|
||||||
// event resizing w/ 'view' methods...
|
// event resizing w/ 'view' methods...
|
||||||
|
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
function _renderDaySegs(segs, rowCnt, view, minLeft, maxLeft, getRow, dayContentLeft, dayContentRight, segmentContainer, bindSegHandlers, modifiedEventId) {
|
function _renderDaySegs(segs, rowCnt, view, minLeft, maxLeft, getRow, dayContentLeft, dayContentRight, segmentContainer, bindSegHandlers, modifiedEventId) {
|
||||||
|
@ -556,7 +556,7 @@ function _renderDaySegs(segs, rowCnt, view, minLeft, maxLeft, getRow, dayContent
|
||||||
:'') +
|
:'') +
|
||||||
"<span class='fc-event-title'>" + htmlEscape(event.title) + "</span>" +
|
"<span class='fc-event-title'>" + htmlEscape(event.title) + "</span>" +
|
||||||
"</a>" +
|
"</a>" +
|
||||||
((event.editable || event.editable == undefined && options.editable) && !options.disableResizing && $.fn.resizable ?
|
((event.editable || event.editable === undefined && options.editable) && !options.disableResizing && $.fn.resizable ?
|
||||||
"<div class='ui-resizable-handle ui-resizable-" + (rtl ? 'w' : 'e') + "'></div>"
|
"<div class='ui-resizable-handle ui-resizable-" + (rtl ? 'w' : 'e') + "'></div>"
|
||||||
: '') +
|
: '') +
|
||||||
"</div>";
|
"</div>";
|
||||||
|
@ -601,7 +601,7 @@ function _renderDaySegs(segs, rowCnt, view, minLeft, maxLeft, getRow, dayContent
|
||||||
seg = segs[i];
|
seg = segs[i];
|
||||||
if (eventElement = seg.element) {
|
if (eventElement = seg.element) {
|
||||||
val = hsideCache[key = seg.key = cssKey(eventElement[0])];
|
val = hsideCache[key = seg.key = cssKey(eventElement[0])];
|
||||||
seg.hsides = val == undefined ? (hsideCache[key] = hsides(eventElement[0], true)) : val;
|
seg.hsides = val === undefined ? (hsideCache[key] = hsides(eventElement[0], true)) : val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -619,7 +619,7 @@ function _renderDaySegs(segs, rowCnt, view, minLeft, maxLeft, getRow, dayContent
|
||||||
if (eventElement = seg.element) {
|
if (eventElement = seg.element) {
|
||||||
val = vmarginCache[key = seg.key];
|
val = vmarginCache[key = seg.key];
|
||||||
seg.outerHeight = eventElement[0].offsetHeight + (
|
seg.outerHeight = eventElement[0].offsetHeight + (
|
||||||
val == undefined ? (vmarginCache[key] = vmargins(eventElement[0])) : val
|
val === undefined ? (vmarginCache[key] = vmargins(eventElement[0])) : val
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
40
src/main.js
40
src/main.js
|
@ -94,7 +94,7 @@ var rtlDefaults = {
|
||||||
// function for adding/overriding defaults
|
// function for adding/overriding defaults
|
||||||
var setDefaults = fc.setDefaults = function(d) {
|
var setDefaults = fc.setDefaults = function(d) {
|
||||||
$.extend(true, defaults, d);
|
$.extend(true, defaults, d);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,12 +111,12 @@ $.fn.fullCalendar = function(options) {
|
||||||
var data = $.data(this, 'fullCalendar');
|
var data = $.data(this, 'fullCalendar');
|
||||||
if (data) {
|
if (data) {
|
||||||
var r = data[options].apply(this, args);
|
var r = data[options].apply(this, args);
|
||||||
if (res == undefined) {
|
if (res === undefined) {
|
||||||
res = r;
|
res = r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (res != undefined) {
|
if (res !== undefined) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
@ -136,7 +136,7 @@ $.fn.fullCalendar = function(options) {
|
||||||
// initialize options
|
// initialize options
|
||||||
options = $.extend(true, {},
|
options = $.extend(true, {},
|
||||||
defaults,
|
defaults,
|
||||||
(options.isRTL || options.isRTL==undefined && defaults.isRTL) ? rtlDefaults : {},
|
(options.isRTL || options.isRTL===undefined && defaults.isRTL) ? rtlDefaults : {},
|
||||||
options
|
options
|
||||||
);
|
);
|
||||||
var tm = options.theme ? 'ui' : 'fc'; // for making theme classes
|
var tm = options.theme ? 'ui' : 'fc'; // for making theme classes
|
||||||
|
@ -171,16 +171,16 @@ $.fn.fullCalendar = function(options) {
|
||||||
element.addClass('ui-widget');
|
element.addClass('ui-widget');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.year != undefined && options.year != date.getFullYear()) {
|
if (options.year !== undefined && options.year != date.getFullYear()) {
|
||||||
date.setDate(1);
|
date.setDate(1);
|
||||||
date.setMonth(0);
|
date.setMonth(0);
|
||||||
date.setFullYear(options.year);
|
date.setFullYear(options.year);
|
||||||
}
|
}
|
||||||
if (options.month != undefined && options.month != date.getMonth()) {
|
if (options.month !== undefined && options.month != date.getMonth()) {
|
||||||
date.setDate(1);
|
date.setDate(1);
|
||||||
date.setMonth(options.month);
|
date.setMonth(options.month);
|
||||||
}
|
}
|
||||||
if (options.date != undefined) {
|
if (options.date !== undefined) {
|
||||||
date.setDate(options.date);
|
date.setDate(options.date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ $.fn.fullCalendar = function(options) {
|
||||||
if (elementVisible()) {
|
if (elementVisible()) {
|
||||||
ignoreWindowResize++; // because view.renderEvents might temporarily change the height before setSize is reached
|
ignoreWindowResize++; // because view.renderEvents might temporarily change the height before setSize is reached
|
||||||
|
|
||||||
if (suggestedViewHeight == undefined) {
|
if (suggestedViewHeight === undefined) {
|
||||||
calcSize();
|
calcSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,7 +353,7 @@ $.fn.fullCalendar = function(options) {
|
||||||
eventEnd = cloneDate(view.visEnd);
|
eventEnd = cloneDate(view.visEnd);
|
||||||
var queued = eventSources.length,
|
var queued = eventSources.length,
|
||||||
sourceDone = function() {
|
sourceDone = function() {
|
||||||
if (--queued == 0) {
|
if (!--queued) {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(events);
|
callback(events);
|
||||||
}
|
}
|
||||||
|
@ -462,7 +462,7 @@ $.fn.fullCalendar = function(options) {
|
||||||
},
|
},
|
||||||
|
|
||||||
option: function(name, value) {
|
option: function(name, value) {
|
||||||
if (value == undefined) {
|
if (value === undefined) {
|
||||||
return options[name];
|
return options[name];
|
||||||
}
|
}
|
||||||
if (name == 'height' || name == 'contentHeight' || name == 'aspectRatio') {
|
if (name == 'height' || name == 'contentHeight' || name == 'aspectRatio') {
|
||||||
|
@ -511,13 +511,13 @@ $.fn.fullCalendar = function(options) {
|
||||||
if (typeof year == 'object') {
|
if (typeof year == 'object') {
|
||||||
date = cloneDate(year); // provided 1 argument, a Date
|
date = cloneDate(year); // provided 1 argument, a Date
|
||||||
}else{
|
}else{
|
||||||
if (year != undefined) {
|
if (year !== undefined) {
|
||||||
date.setFullYear(year);
|
date.setFullYear(year);
|
||||||
}
|
}
|
||||||
if (month != undefined) {
|
if (month !== undefined) {
|
||||||
date.setMonth(month);
|
date.setMonth(month);
|
||||||
}
|
}
|
||||||
if (dateNum != undefined) {
|
if (dateNum !== undefined) {
|
||||||
date.setDate(dateNum);
|
date.setDate(dateNum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -525,13 +525,13 @@ $.fn.fullCalendar = function(options) {
|
||||||
},
|
},
|
||||||
|
|
||||||
incrementDate: function(years, months, days) {
|
incrementDate: function(years, months, days) {
|
||||||
if (years != undefined) {
|
if (years !== undefined) {
|
||||||
addYears(date, years);
|
addYears(date, years);
|
||||||
}
|
}
|
||||||
if (months != undefined) {
|
if (months !== undefined) {
|
||||||
addMonths(date, months);
|
addMonths(date, months);
|
||||||
}
|
}
|
||||||
if (days != undefined) {
|
if (days !== undefined) {
|
||||||
addDays(date, days);
|
addDays(date, days);
|
||||||
}
|
}
|
||||||
render();
|
render();
|
||||||
|
@ -691,7 +691,7 @@ $.fn.fullCalendar = function(options) {
|
||||||
else if (views[buttonName]) {
|
else if (views[buttonName]) {
|
||||||
buttonClick = function() {
|
buttonClick = function() {
|
||||||
button.removeClass(tm + '-state-hover');
|
button.removeClass(tm + '-state-hover');
|
||||||
changeView(buttonName)
|
changeView(buttonName);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (buttonClick) {
|
if (buttonClick) {
|
||||||
|
@ -807,7 +807,7 @@ $.fn.fullCalendar = function(options) {
|
||||||
lateRender();
|
lateRender();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
$(window).resize(windowResize);
|
$(window).resize(windowResize);
|
||||||
|
|
||||||
|
|
||||||
|
@ -846,7 +846,7 @@ $.fn.fullCalendar = function(options) {
|
||||||
var fakeID = 0;
|
var fakeID = 0;
|
||||||
|
|
||||||
function normalizeEvent(event, options) {
|
function normalizeEvent(event, options) {
|
||||||
event._id = event._id || (event.id == undefined ? '_fc' + fakeID++ : event.id + '');
|
event._id = event._id || (event.id === undefined ? '_fc' + fakeID++ : event.id + '');
|
||||||
if (event.date) {
|
if (event.date) {
|
||||||
if (!event.start) {
|
if (!event.start) {
|
||||||
event.start = event.date;
|
event.start = event.date;
|
||||||
|
@ -859,7 +859,7 @@ function normalizeEvent(event, options) {
|
||||||
event.end = null;
|
event.end = null;
|
||||||
}
|
}
|
||||||
event._end = event.end ? cloneDate(event.end) : null;
|
event._end = event.end ? cloneDate(event.end) : null;
|
||||||
if (event.allDay == undefined) {
|
if (event.allDay === undefined) {
|
||||||
event.allDay = options.allDayDefault;
|
event.allDay = options.allDayDefault;
|
||||||
}
|
}
|
||||||
if (event.className) {
|
if (event.className) {
|
||||||
|
|
41
src/util.js
41
src/util.js
|
@ -79,13 +79,13 @@ function zeroDate() { // returns a Date with time 00:00:00 and dateOfMonth=1
|
||||||
var i=0, d;
|
var i=0, d;
|
||||||
do {
|
do {
|
||||||
d = new Date(1970, i++, 1);
|
d = new Date(1970, i++, 1);
|
||||||
} while (d.getHours() != 0);
|
} while (d.getHours()); // != 0
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
function skipWeekend(date, inc, excl) {
|
function skipWeekend(date, inc, excl) {
|
||||||
inc = inc || 1;
|
inc = inc || 1;
|
||||||
while (date.getDay()==0 || (excl && date.getDay()==1 || !excl && date.getDay()==6)) {
|
while (!date.getDay() || (excl && date.getDay()==1 || !excl && date.getDay()==6)) {
|
||||||
addDays(date, inc);
|
addDays(date, inc);
|
||||||
}
|
}
|
||||||
return date;
|
return date;
|
||||||
|
@ -111,7 +111,7 @@ var parseDate = fc.parseDate = function(s) {
|
||||||
}
|
}
|
||||||
// TODO: never return invalid dates (like from new Date(<string>)), return null instead
|
// TODO: never return invalid dates (like from new Date(<string>)), return null instead
|
||||||
return null;
|
return null;
|
||||||
}
|
};
|
||||||
|
|
||||||
var parseISO8601 = fc.parseISO8601 = function(s, ignoreTimezone) {
|
var parseISO8601 = fc.parseISO8601 = function(s, ignoreTimezone) {
|
||||||
// derived from http://delete.me.uk/2005/03/iso8601.html
|
// derived from http://delete.me.uk/2005/03/iso8601.html
|
||||||
|
@ -153,7 +153,7 @@ var parseISO8601 = fc.parseISO8601 = function(s, ignoreTimezone) {
|
||||||
offset -= date.getTimezoneOffset();
|
offset -= date.getTimezoneOffset();
|
||||||
}
|
}
|
||||||
return new Date(+date + (offset * 60 * 1000));
|
return new Date(+date + (offset * 60 * 1000));
|
||||||
}
|
};
|
||||||
|
|
||||||
var parseTime = fc.parseTime = function(s) { // returns minutes since start of day
|
var parseTime = fc.parseTime = function(s) { // returns minutes since start of day
|
||||||
if (typeof s == 'number') { // an hour
|
if (typeof s == 'number') { // an hour
|
||||||
|
@ -182,7 +182,7 @@ var parseTime = fc.parseTime = function(s) { // returns minutes since start of d
|
||||||
|
|
||||||
var formatDate = fc.formatDate = function(date, format, options) {
|
var formatDate = fc.formatDate = function(date, format, options) {
|
||||||
return formatDates(date, null, format, options);
|
return formatDates(date, null, format, options);
|
||||||
}
|
};
|
||||||
|
|
||||||
var formatDates = fc.formatDates = function(date1, date2, format, options) {
|
var formatDates = fc.formatDates = function(date1, date2, format, options) {
|
||||||
options = options || defaults;
|
options = options || defaults;
|
||||||
|
@ -259,7 +259,7 @@ var formatDates = fc.formatDates = function(date1, date2, format, options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
};
|
||||||
|
|
||||||
var dateFormatters = {
|
var dateFormatters = {
|
||||||
s : function(d) { return d.getSeconds() },
|
s : function(d) { return d.getSeconds() },
|
||||||
|
@ -287,7 +287,9 @@ var dateFormatters = {
|
||||||
u : function(d) { return formatDate(d, "yyyy-MM-dd'T'HH:mm:ss'Z'") },
|
u : function(d) { return formatDate(d, "yyyy-MM-dd'T'HH:mm:ss'Z'") },
|
||||||
S : function(d) {
|
S : function(d) {
|
||||||
var date = d.getDate();
|
var date = d.getDate();
|
||||||
if (date > 10 && date < 20) return 'th';
|
if (date > 10 && date < 20) {
|
||||||
|
return 'th';
|
||||||
|
}
|
||||||
return ['st', 'nd', 'rd'][date%10-1] || 'th';
|
return ['st', 'nd', 'rd'][date%10-1] || 'th';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -359,7 +361,7 @@ function topCorrect(tr) { // tr/th/td or anything else
|
||||||
if (tr.is('th,td')) {
|
if (tr.is('th,td')) {
|
||||||
tr = (cell = tr).parent();
|
tr = (cell = tr).parent();
|
||||||
}
|
}
|
||||||
if (topBug == undefined && tr.is('tr')) {
|
if (topBug === undefined && tr.is('tr')) {
|
||||||
topBug = tr.position().top != tr.children().position().top;
|
topBug = tr.position().top != tr.children().position().top;
|
||||||
}
|
}
|
||||||
if (topBug) {
|
if (topBug) {
|
||||||
|
@ -393,14 +395,14 @@ function HoverMatrix(changeCallback) {
|
||||||
};
|
};
|
||||||
|
|
||||||
t.mouse = function(x, y) {
|
t.mouse = function(x, y) {
|
||||||
if (origRow == undefined) {
|
if (origRow === undefined) {
|
||||||
tops.push(tops[tops.length-1] + prevRowE.outerHeight());
|
tops.push(tops[tops.length-1] + prevRowE.outerHeight());
|
||||||
lefts.push(lefts[lefts.length-1] + prevColE.outerWidth());
|
lefts.push(lefts[lefts.length-1] + prevColE.outerWidth());
|
||||||
currRow = currCol = -1;
|
currRow = currCol = -1;
|
||||||
}
|
}
|
||||||
var r, c;
|
var r, c;
|
||||||
for (r=0; r<tops.length && y>=tops[r]; r++) ;
|
for (r=0; r<tops.length && y>=tops[r]; r++) {}
|
||||||
for (c=0; c<lefts.length && x>=lefts[c]; c++) ;
|
for (c=0; c<lefts.length && x>=lefts[c]; c++) {}
|
||||||
r = r >= tops.length ? -1 : r - 1;
|
r = r >= tops.length ? -1 : r - 1;
|
||||||
c = c >= lefts.length ? -1 : c - 1;
|
c = c >= lefts.length ? -1 : c - 1;
|
||||||
if (r != currRow || c != currCol) {
|
if (r != currRow || c != currCol) {
|
||||||
|
@ -409,7 +411,7 @@ function HoverMatrix(changeCallback) {
|
||||||
if (r == -1 || c == -1) {
|
if (r == -1 || c == -1) {
|
||||||
t.cell = null;
|
t.cell = null;
|
||||||
}else{
|
}else{
|
||||||
if (origRow == undefined) {
|
if (origRow === undefined) {
|
||||||
origRow = r;
|
origRow = r;
|
||||||
origCol = c;
|
origCol = c;
|
||||||
}
|
}
|
||||||
|
@ -445,14 +447,14 @@ function zeroPad(n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function smartProperty(obj, name) { // get a camel-cased/namespaced property of an object
|
function smartProperty(obj, name) { // get a camel-cased/namespaced property of an object
|
||||||
if (obj[name] != undefined) {
|
if (obj[name] !== undefined) {
|
||||||
return obj[name];
|
return obj[name];
|
||||||
}
|
}
|
||||||
var parts = name.split(/(?=[A-Z])/),
|
var parts = name.split(/(?=[A-Z])/),
|
||||||
i=parts.length-1, res;
|
i=parts.length-1, res;
|
||||||
for (; i>=0; i--) {
|
for (; i>=0; i--) {
|
||||||
res = obj[parts[i].toLowerCase()];
|
res = obj[parts[i].toLowerCase()];
|
||||||
if (res != undefined) {
|
if (res !== undefined) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -465,7 +467,7 @@ function htmlEscape(s) {
|
||||||
.replace(/</g, '<')
|
.replace(/</g, '<')
|
||||||
.replace(/>/g, '>')
|
.replace(/>/g, '>')
|
||||||
.replace(/'/g, ''')
|
.replace(/'/g, ''')
|
||||||
.replace(/"/g, '"')
|
.replace(/"/g, '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -478,18 +480,15 @@ function HorizontalPositionCache(getElement) {
|
||||||
rights = {};
|
rights = {};
|
||||||
|
|
||||||
function e(i) {
|
function e(i) {
|
||||||
return elements[i] =
|
return elements[i] = elements[i] || getElement(i);
|
||||||
elements[i] || getElement(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
t.left = function(i) {
|
t.left = function(i) {
|
||||||
return lefts[i] =
|
return lefts[i] = lefts[i] === undefined ? e(i).position().left : lefts[i];
|
||||||
lefts[i] == undefined ? e(i).position().left : lefts[i];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
t.right = function(i) {
|
t.right = function(i) {
|
||||||
return rights[i] =
|
return rights[i] = rights[i] === undefined ? t.left(i) + e(i).width() : rights[i];
|
||||||
rights[i] == undefined ? t.left(i) + e(i).width() : rights[i];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
t.clear = function() {
|
t.clear = function() {
|
||||||
|
|
|
@ -150,7 +150,7 @@ var viewMethods = {
|
||||||
minuteDelta = minuteDelta || 0;
|
minuteDelta = minuteDelta || 0;
|
||||||
for (var e, len=events.length, i=0; i<len; i++) {
|
for (var e, len=events.length, i=0; i<len; i++) {
|
||||||
e = events[i];
|
e = events[i];
|
||||||
if (allDay != undefined) {
|
if (allDay !== undefined) {
|
||||||
e.allDay = allDay;
|
e.allDay = allDay;
|
||||||
}
|
}
|
||||||
addMinutes(addDays(e.start, dayDelta, true), minuteDelta);
|
addMinutes(addDays(e.start, dayDelta, true), minuteDelta);
|
||||||
|
@ -319,7 +319,7 @@ function lazySegBind(container, segs, bindHandlers) {
|
||||||
e = parent;
|
e = parent;
|
||||||
parent = parent.parentNode;
|
parent = parent.parentNode;
|
||||||
}
|
}
|
||||||
if ((i = e._fci) != undefined) {
|
if ((i = e._fci) !== undefined) {
|
||||||
e._fci = undefined;
|
e._fci = undefined;
|
||||||
seg = segs[i];
|
seg = segs[i];
|
||||||
bindHandlers(seg.event, seg.element, seg);
|
bindHandlers(seg.event, seg.element, seg);
|
||||||
|
|
Loading…
Reference in a new issue