Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
lib-ical
Commits
494fc64d
Commit
494fc64d
authored
Dec 08, 2015
by
Andi Sidwell
Browse files
Stop throwing errors when no end date provided
parent
c8fc0cf7
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/event.js
View file @
494fc64d
...
...
@@ -562,9 +562,6 @@ var ICalEvent = function(_data) {
if
(
!
data
.
start
)
{
throw
'
No value for `start` in ICalEvent #
'
+
data
.
id
+
'
given!
'
;
}
if
(
!
data
.
end
)
{
throw
'
No value for `end` in ICalEvent #
'
+
data
.
id
+
'
given!
'
;
}
// DATE & TIME
g
+=
'
BEGIN:VEVENT
\r\n
'
;
...
...
@@ -572,10 +569,14 @@ var ICalEvent = function(_data) {
g
+=
'
DTSTAMP:
'
+
tools
.
formatDate
(
data
.
stamp
)
+
'
\r\n
'
;
if
(
data
.
allDay
)
{
g
+=
'
DTSTART;VALUE=DATE:
'
+
tools
.
formatDate
(
data
.
start
,
true
)
+
'
\r\n
'
;
g
+=
'
DTEND;VALUE=DATE:
'
+
tools
.
formatDate
(
data
.
end
,
true
)
+
'
\r\n
'
;
if
(
data
.
end
)
{
g
+=
'
DTEND;VALUE=DATE:
'
+
tools
.
formatDate
(
data
.
end
,
true
)
+
'
\r\n
'
;
}
}
else
{
g
+=
'
DTSTART:
'
+
tools
.
formatDate
(
data
.
start
,
false
,
data
.
floating
)
+
'
\r\n
'
;
g
+=
'
DTEND:
'
+
tools
.
formatDate
(
data
.
end
,
false
,
data
.
floating
)
+
'
\r\n
'
;
if
(
data
.
end
)
{
g
+=
'
DTEND:
'
+
tools
.
formatDate
(
data
.
end
,
false
,
data
.
floating
)
+
'
\r\n
'
;
}
}
// REPEATING
...
...
test/test_0.2.x.js
View file @
494fc64d
...
...
@@ -264,11 +264,6 @@ describe('ical-generator 0.2.x / ICalCalendar', function() {
assert
.
throws
(
function
()
{
cal
.
save
(
file
);
},
/`start`/
);
e
.
start
(
new
Date
());
assert
.
throws
(
function
()
{
cal
.
save
(
file
);
},
/`end`/
);
});
});
...
...
@@ -296,12 +291,6 @@ describe('ical-generator 0.2.x / ICalCalendar', function() {
/*jslint stupid: true */
cal
.
saveSync
(
file
);
},
/`start`/
);
e
.
start
(
new
Date
());
assert
.
throws
(
function
()
{
/*jslint stupid: true */
cal
.
saveSync
(
file
);
},
/`end`/
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment