Kaynağa Gözat

bad event object end dates should resolve to null

Adam Shaw 11 yıl önce
ebeveyn
işleme
4d593cf2c5
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  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) {
 			if (end) {
 				end = t.moment(end);
 				end = t.moment(end);
 				if (!end.isValid()) {
 				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.allDay = allDay;
 		event.start = start;
 		event.start = start;
 		event.end = end || null; // ensure null if falsy
 		event.end = end || null; // ensure null if falsy