From c60a60422f69e29628b6c946a15be271e90015aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 10 Nov 2021 00:47:10 +0100 Subject: Basic event modification works again. --- static/vevent.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'static/vevent.ts') diff --git a/static/vevent.ts b/static/vevent.ts index c9068106..d8ef58ce 100644 --- a/static/vevent.ts +++ b/static/vevent.ts @@ -1,4 +1,4 @@ -import { ical_type, valid_input_types, JCal } from './types' +import { ical_type, valid_input_types, JCal, JCalProperty } from './types' import { uid, parseDate } from './lib' export { VEvent, xml_to_vcal } @@ -141,11 +141,14 @@ class VEvent { } to_jcal(): JCal { - let out_properties = [] - for (let [key, value] of Object.entries(this.properties)) { - let sub = value.to_jcal(); - sub.unshift(key) - out_properties.push(sub); + let out_properties: JCalProperty[] = [] + console.log(this.properties); + for (let [key, value] of this.properties) { + let prop: JCalProperty = [ + key.toLowerCase(), + ...value.to_jcal(), + ] + out_properties.push(prop); } return ['vevent', out_properties, [/* alarms go here*/]] } -- cgit v1.2.3