aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-11-18 21:41:01 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-11-18 21:41:01 +0100
commit5cd004b662caabc4a084d625da798b1b64d8b5c4 (patch)
tree70e238c6c220bdb88b7d5f2e6bfa5b9e8a9f1ca3 /static
parentAdd setProperties, add type info to setProperty. (diff)
downloadcalp-5cd004b662caabc4a084d625da798b1b64d8b5c4.tar.gz
calp-5cd004b662caabc4a084d625da798b1b64d8b5c4.tar.xz
Minor fixes.
Diffstat (limited to 'static')
-rw-r--r--static/components/vevent-dl.ts9
-rw-r--r--static/types.ts9
2 files changed, 14 insertions, 4 deletions
diff --git a/static/components/vevent-dl.ts b/static/components/vevent-dl.ts
index a9e60d81..75de075b 100644
--- a/static/components/vevent-dl.ts
+++ b/static/components/vevent-dl.ts
@@ -18,7 +18,14 @@ function buildDescriptionList(data: [string, any][]): HTMLElement {
let dl = document.createElement('dl');
for (let [key, val] of data) {
dl.appendChild(makeElement('dt', { innerText: key }))
- dl.appendChild(makeElement('dd', { innerText: val }))
+ let fmtVal: string = val;
+ if (val instanceof Date) {
+ fmtVal = val.format(
+ val.dateonly
+ ? '~Y-~m-~d'
+ : '~Y-~m-~dT~H:~M:~S');
+ }
+ dl.appendChild(makeElement('dd', { innerText: fmtVal }))
}
return dl;
}
diff --git a/static/types.ts b/static/types.ts
index f371c72a..2c26308e 100644
--- a/static/types.ts
+++ b/static/types.ts
@@ -13,14 +13,15 @@ let all_types = [
'integer', /* Number.type = 'integer' */
'date-time', /* Date */
'date', /* Date.dateonly = true */
- 'duration',
- 'period',
- 'utc-offset',
+ 'duration', /* TODO */
+ 'period', /* TODO */
+ 'utc-offset', /* TODO */
'cal-address',
'recur', /* RRule */
'boolean', /* boolean */
]
+
type ical_type
= 'text'
| 'uri'
@@ -147,6 +148,7 @@ let valid_input_types: Map<string, ical_type | ical_type[]> =
['DUE', ['date', 'date-time']],
['DURATION', ['duration']],
['EXDATE', [['date', 'date-time']]],
+ ['EXRULE', []], /* deprecated */
['FREEBUSY', [['period']]],
['GEO', ['float']], // pair of floats
['LAST-MODIFIED', ['date-time']],
@@ -173,6 +175,7 @@ let valid_input_types: Map<string, ical_type | ical_type[]> =
['TZOFFSETFROM', ['utc-offset']],
['TZOFFSETTO', ['utc-offset']],
['TZURL', ['uri']],
+ ['UID', ['text']],
['URL', ['uri']],
['VERSION', ['text']],
]) as Map<string, ical_type | ical_type[]>