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
8233807b
Commit
8233807b
authored
Dec 14, 2015
by
Sebastian
Browse files
Code Style
parent
dc9a8ad6
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/_tools.js
View file @
8233807b
...
...
@@ -30,16 +30,16 @@ module.exports.formatDate = function formatDate(d, dateonly, floating) {
// For information about this format, see RFC 5545, section 3.3.5
// https://tools.ietf.org/html/rfc5545#section-3.3.5
module
.
exports
.
formatDateTZ
=
function
formatDateTZ
(
property
,
date
,
eventData
)
{
var
tzParam
=
''
;
var
floating
=
eventData
.
floating
;
var
tzParam
=
''
;
var
floating
=
eventData
.
floating
;
if
(
eventData
.
timezone
)
{
tzParam
=
'
;TZID=
'
+
eventData
.
timezone
;
if
(
eventData
.
timezone
)
{
tzParam
=
'
;TZID=
'
+
eventData
.
timezone
;
// This isn't a 'floating' event because it has a timezone;
// but we use it to omit the 'Z' UTC specifier in formatDate()
floating
=
true
;
}
// This isn't a 'floating' event because it has a timezone;
// but we use it to omit the 'Z' UTC specifier in formatDate()
floating
=
true
;
}
return
property
+
tzParam
+
'
:
'
+
module
.
exports
.
formatDate
(
date
,
false
,
floating
);
};
...
...
lib/event.js
View file @
8233807b
...
...
@@ -612,12 +612,12 @@ 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
'
;
if
(
data
.
end
)
{
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
+=
tools
.
formatDateTZ
(
'
DTSTART
'
,
data
.
start
,
data
)
+
'
\r\n
'
;
if
(
data
.
end
)
{
if
(
data
.
end
)
{
g
+=
tools
.
formatDateTZ
(
'
DTEND
'
,
data
.
end
,
data
)
+
'
\r\n
'
;
}
}
...
...
test/test_0.2.x.js
View file @
8233807b
...
...
@@ -232,7 +232,7 @@ describe('ical-generator 0.2.x / ICalCalendar', function() {
});
it
(
'
should not require optional parameters
'
,
function
()
{
assert
.
doesNotThrow
(
function
()
{
assert
.
doesNotThrow
(
function
()
{
ical
().
addEvent
({
start
:
new
Date
(),
summary
:
'
Patch-Day
'
...
...
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