Commit 2b2deeb8 authored by Sebastian's avatar Sebastian
Browse files

ICalTools.duration: DAYS support

parent b94bfdcd
......@@ -46,7 +46,18 @@ module.exports.duration = function duration(seconds) {
seconds *= -1;
}
string += 'PT';
string += 'P';
// DAYS
if(seconds >= 86400) {
string += Math.floor(seconds / 86400) + 'D';
seconds %= 86400;
}
if(!seconds && string.length > 1) {
return string;
}
string += 'T';
// HOURS
if(seconds >= 3600) {
......
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