diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-09 19:17:46 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-09 19:17:46 +0100 |
commit | 15e50471776e702333920b188932f03ee1f8573b (patch) | |
tree | 6129332e6591cbe685f999550b6891c717126401 /static/jcal.ts | |
parent | CSS to prevent event blocks from overflowing. (diff) | |
download | calp-15e50471776e702333920b188932f03ee1f8573b.tar.gz calp-15e50471776e702333920b188932f03ee1f8573b.tar.xz |
Propagate recurring events to frontend.
This handles each instance of a recurring event as its own unique event,
which allows us to properly send it to the frontend. It's currently not
possible to submit the repeating events back, but that is probably a
underlying problem.
Diffstat (limited to 'static/jcal.ts')
-rw-r--r-- | static/jcal.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/static/jcal.ts b/static/jcal.ts index 605f41e7..41f33db4 100644 --- a/static/jcal.ts +++ b/static/jcal.ts @@ -33,9 +33,17 @@ function jcal_type_to_xcal(doc: Document, type: ical_type, value: any): Element case 'recur': for (var key in value) { if (!value.hasOwnProperty(key)) continue; - let e = doc.createElementNS(xcal, key); - e.textContent = value[key]; - el.appendChild(e); + if (key === 'byday') { + for (let v of value[key]) { + let e = doc.createElementNS(xcal, key); + e.textContent = v; + el.appendChild(e); + } + } else { + let e = doc.createElementNS(xcal, key); + e.textContent = value[key]; + el.appendChild(e); + } } break; |