Commit dc9a8ad6 authored by Sebastian's avatar Sebastian
Browse files

Event: 1970-01-01 fix

[close #35]
parent 7a795bb4
......@@ -99,7 +99,7 @@ var ICalEvent = function(_data) {
if(typeof start === 'string') {
start = new Date(start);
}
if(!(start instanceof Date) || !start.getTime()) {
if(!(start instanceof Date) || isNaN(start.getTime())) {
throw '`start` must be a Date Object!';
}
data.start = start;
......@@ -128,7 +128,7 @@ var ICalEvent = function(_data) {
if(typeof end === 'string') {
end = new Date(end);
}
if(!(end instanceof Date) || !end.getTime()) {
if(!(end instanceof Date) || isNaN(end.getTime())) {
throw '`end` must be a Date Object!';
}
data.end = end;
......@@ -177,7 +177,7 @@ var ICalEvent = function(_data) {
if(typeof stamp === 'string') {
stamp = new Date(stamp);
}
if(!(stamp instanceof Date) || !stamp.getTime()) {
if(!(stamp instanceof Date) || isNaN(stamp.getTime())) {
throw '`stamp` must be a Date Object!';
}
data.stamp = stamp;
......@@ -271,7 +271,7 @@ var ICalEvent = function(_data) {
if(typeof repeating.until === 'string') {
repeating.until = new Date(repeating.until);
}
if(!(repeating.until instanceof Date) || !repeating.until.getTime()) {
if(!(repeating.until instanceof Date) || isNaN(repeating.until.getTime())) {
throw '`repeating.until` must be a Date Object!';
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment