Explorar o código

bad event object end dates should resolve to null

Adam Shaw %!s(int64=11) %!d(string=hai) anos
pai
achega
4d593cf2c5
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/EventManager.js

+ 5 - 1
src/EventManager.js

@@ -531,7 +531,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
 				}
 			}
 
@@ -583,6 +583,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