diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-01-12 23:42:21 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-01-12 23:42:21 +0100 |
commit | e4c57ab3e9d63bac105c4748eac378de5d2478a3 (patch) | |
tree | b85b8e2e19e57e800024a4097ca0fdd14c882a9f /static | |
parent | Can create event with new interface. (diff) | |
download | calp-e4c57ab3e9d63bac105c4748eac378de5d2478a3.tar.gz calp-e4c57ab3e9d63bac105c4748eac378de5d2478a3.tar.xz |
Fix jcal->xcal rrule generation
Diffstat (limited to 'static')
-rw-r--r-- | static/jcal.js | 7 | ||||
-rw-r--r-- | static/rrule.js | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/static/jcal.js b/static/jcal.js index 38aeaae9..da17a19e 100644 --- a/static/jcal.js +++ b/static/jcal.js @@ -26,7 +26,12 @@ function jcal_type_to_xcal(doc, type, value) { break; case 'recur': - el.appendChild(recur_jcal_to_rrule(value).asXcal(doc)); + for (var key in value) { + if (! value.hasOwnProperty(key)) continue; + let e = doc.createElementNS(xcal, key); + e.innerHTML = value[key]; + el.appendChild(e); + } break; case 'date': diff --git a/static/rrule.js b/static/rrule.js index f11cc640..67a4453f 100644 --- a/static/rrule.js +++ b/static/rrule.js @@ -59,6 +59,9 @@ class RRule { this.listeners[field].push(proc); } + /* NOTE this function is probably never used. + Deperate it and refer to RRule.asJcal + together with jcal_to_xcal */ asXcal(doc) { /* TODO empty case */ // let str = "<recur>"; @@ -77,7 +80,7 @@ class RRule { asJcal() { let obj = {}; for (let f of this.fields) { - let v = this.fields[f]; + let v = this[f]; if (! v) continue; /* TODO special formatting for some types */ obj[f] = v; |