fixed: all-day events

This commit is contained in:
quenousimporte 2024-01-22 14:47:40 +01:00
parent 816b4f1e77
commit 872b9492db
1 changed files with 6 additions and 4 deletions

10
ics.php
View File

@ -72,10 +72,12 @@ function ics2json(input)
function dt(s) function dt(s)
{ {
return new Date( var formatted = s.substr(0,4) + "-" + s.substr(4,2) + "-" + s.substr(6,2);
s.substr(0,4) + "-" + s.substr(4,2) + "-" + s.substr(6,2) if (s.length > 8)
+ "T" {
+ s.substr(9,2) + ":" + s.substr(11,2) + ":" + s.substr(13,2)); formatted += "T" + s.substr(9,2) + ":" + s.substr(11,2) + ":" + s.substr(13,2);
}
return new Date(formatted);
} }
function formatdate(d) function formatdate(d)