|
|
@@ -1,5 +1,5 @@
|
|
|
/*!
|
|
|
- * FullCalendar v2.2.2
|
|
|
+ * FullCalendar v2.2.3
|
|
|
* Docs & License: http://arshaw.com/fullcalendar/
|
|
|
* (c) 2013 Adam Shaw
|
|
|
*/
|
|
|
@@ -174,7 +174,7 @@ var rtlDefaults = {
|
|
|
|
|
|
;;
|
|
|
|
|
|
-var fc = $.fullCalendar = { version: "2.2.2" };
|
|
|
+var fc = $.fullCalendar = { version: "2.2.3" };
|
|
|
var fcViews = fc.views = {};
|
|
|
|
|
|
|
|
|
@@ -1588,7 +1588,7 @@ function EventManager(options) { // assumed to be a calendar
|
|
|
function getSourcePrimitive(source) {
|
|
|
return (
|
|
|
(typeof source === 'object') ? // a normalized event source?
|
|
|
- (source.origArray || source.url || source.events) : // get the primitive
|
|
|
+ (source.origArray || source.googleCalendarId || source.url || source.events) : // get the primitive
|
|
|
null
|
|
|
) ||
|
|
|
source; // the given argument *is* the primitive
|
|
|
@@ -1812,7 +1812,7 @@ function EventManager(options) { // assumed to be a calendar
|
|
|
if (end) {
|
|
|
end = t.moment(end);
|
|
|
if (!end.isValid()) {
|
|
|
- return false;
|
|
|
+ end = null; // let defaults take over
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1864,6 +1864,10 @@ function EventManager(options) { // assumed to be a calendar
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (end && end <= start) { // end is exclusive. must be after start
|
|
|
+ end = null; // let defaults take over
|
|
|
+ }
|
|
|
+
|
|
|
event.allDay = allDay;
|
|
|
event.start = start;
|
|
|
event.end = end || null; // ensure null if falsy
|
|
|
@@ -1879,11 +1883,9 @@ function EventManager(options) { // assumed to be a calendar
|
|
|
// If the given event is a recurring event, break it down into an array of individual instances.
|
|
|
// If not a recurring event, return an array with the single original event.
|
|
|
// If given a falsy input (probably because of a failed buildEventFromInput call), returns an empty array.
|
|
|
- function expandEvent(abstractEvent) {
|
|
|
+ // HACK: can override the recurring window by providing custom rangeStart/rangeEnd (for businessHours).
|
|
|
+ function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {
|
|
|
var events = [];
|
|
|
- var view;
|
|
|
- var _rangeStart = rangeStart;
|
|
|
- var _rangeEnd = rangeEnd;
|
|
|
var dowHash;
|
|
|
var dow;
|
|
|
var i;
|
|
|
@@ -1892,12 +1894,8 @@ function EventManager(options) { // assumed to be a calendar
|
|
|
var start, end;
|
|
|
var event;
|
|
|
|
|
|
- // hack for when fetchEvents hasn't been called yet (calculating businessHours for example)
|
|
|
- if (!_rangeStart || !_rangeEnd) {
|
|
|
- view = t.getView();
|
|
|
- _rangeStart = view.start;
|
|
|
- _rangeEnd = view.end;
|
|
|
- }
|
|
|
+ _rangeStart = _rangeStart || rangeStart;
|
|
|
+ _rangeEnd = _rangeEnd || rangeEnd;
|
|
|
|
|
|
if (abstractEvent) {
|
|
|
if (abstractEvent._recurring) {
|
|
|
@@ -2129,7 +2127,7 @@ function EventManager(options) { // assumed to be a calendar
|
|
|
t.getBusinessHoursEvents = getBusinessHoursEvents;
|
|
|
|
|
|
|
|
|
- // Returns an array of events as to when the business hours occur in the current view.
|
|
|
+ // Returns an array of events as to when the business hours occur in the given view.
|
|
|
// Abuse of our event system :(
|
|
|
function getBusinessHoursEvents() {
|
|
|
var optionVal = options.businessHours;
|
|
|
@@ -2140,6 +2138,7 @@ function EventManager(options) { // assumed to be a calendar
|
|
|
dow: [ 1, 2, 3, 4, 5 ], // monday - friday
|
|
|
rendering: 'inverse-background'
|
|
|
};
|
|
|
+ var view = t.getView();
|
|
|
var eventInput;
|
|
|
|
|
|
if (optionVal) {
|
|
|
@@ -2154,7 +2153,11 @@ function EventManager(options) { // assumed to be a calendar
|
|
|
}
|
|
|
|
|
|
if (eventInput) {
|
|
|
- return expandEvent(buildEventFromInput(eventInput));
|
|
|
+ return expandEvent(
|
|
|
+ buildEventFromInput(eventInput),
|
|
|
+ view.start,
|
|
|
+ view.end
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
return [];
|
|
|
@@ -2599,11 +2602,6 @@ function isNativeDate(input) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-function dateCompare(a, b) { // works with Moments and native Dates
|
|
|
- return a - b;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
// Returns a boolean about whether the given input is a time string, like "06:40:00" or "06:00"
|
|
|
function isTimeString(str) {
|
|
|
return /^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(str);
|
|
|
@@ -2668,6 +2666,11 @@ function capitaliseFirstLetter(str) {
|
|
|
}
|
|
|
|
|
|
|
|
|
+function compareNumbers(a, b) { // for .sort()
|
|
|
+ return a - b;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
// Returns a function, that, as long as it continues to be invoked, will not
|
|
|
// be triggered. The function will be called after it stops being called for
|
|
|
// N milliseconds.
|
|
|
@@ -4501,7 +4504,7 @@ $.extend(Grid.prototype, {
|
|
|
|
|
|
dayEl = _this.getCellDayEl(cell);
|
|
|
|
|
|
- dates = [ date, dragListener.origDate ].sort(dateCompare);
|
|
|
+ dates = [ date, dragListener.origDate ].sort(compareNumbers); // works with Moments
|
|
|
start = dates[0];
|
|
|
end = dates[1].clone().add(_this.cellDuration);
|
|
|
|
|
|
@@ -8168,7 +8171,7 @@ function View(calendar) {
|
|
|
var segmentCellLast = cellOffsetToCell(segmentCellOffsetLast);
|
|
|
|
|
|
// view might be RTL, so order by leftmost column
|
|
|
- var cols = [ segmentCellFirst.col, segmentCellLast.col ].sort();
|
|
|
+ var cols = [ segmentCellFirst.col, segmentCellLast.col ].sort(compareNumbers);
|
|
|
|
|
|
// Determine if segment's first/last cell is the beginning/end of the date range.
|
|
|
// We need to compare "day offset" because "cell offsets" are often ambiguous and
|