diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-18 21:41:01 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-18 21:41:01 +0100 |
commit | 5cd004b662caabc4a084d625da798b1b64d8b5c4 (patch) | |
tree | 70e238c6c220bdb88b7d5f2e6bfa5b9e8a9f1ca3 /static/components | |
parent | Add setProperties, add type info to setProperty. (diff) | |
download | calp-5cd004b662caabc4a084d625da798b1b64d8b5c4.tar.gz calp-5cd004b662caabc4a084d625da798b1b64d8b5c4.tar.xz |
Minor fixes.
Diffstat (limited to '')
-rw-r--r-- | static/components/vevent-dl.ts | 9 |
1 files changed, 8 insertions, 1 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; } |