Commit ac8a80eb authored by Andi Sidwell's avatar Andi Sidwell
Browse files

Add timezone ID output on event dates

parent 528d0379
......@@ -27,8 +27,21 @@ module.exports.formatDate = function formatDate(d, dateonly, floating) {
return s;
};
module.exports.formatDateTZ = function formatDateTZ(property, date, evt) {
return property + ':' + module.exports.formatDate(date, false, evt.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;
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;
}
return property + tzParam + ':' + module.exports.formatDate(date, false, floating);
};
module.exports.escape = function escape(str) {
......
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