diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-18 21:40:19 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-18 21:40:19 +0100 |
commit | e5d682702f6954ebab946ca0eb67ab22f465f6ea (patch) | |
tree | 34373f2f20154f6fcbfb4e534c69ff55fa23715c /static/event-creator.ts | |
parent | Remove .interactive, fix date-time checkbox. (diff) | |
download | calp-e5d682702f6954ebab946ca0eb67ab22f465f6ea.tar.gz calp-e5d682702f6954ebab946ca0eb67ab22f465f6ea.tar.xz |
Add setProperties, add type info to setProperty.
Diffstat (limited to 'static/event-creator.ts')
-rw-r--r-- | static/event-creator.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/static/event-creator.ts b/static/event-creator.ts index 97ffbd62..6be94a9d 100644 --- a/static/event-creator.ts +++ b/static/event-creator.ts @@ -3,8 +3,8 @@ export { EventCreator } import { VEvent } from './vevent' import { v4 as uuid } from 'uuid' import { ComponentBlock } from './components/vevent-block' -import { round_time } from './lib' -import { parseDate } from './lib' +import { round_time, parseDate } from './lib' +import { ical_type } from './types' class EventCreator { @@ -148,10 +148,11 @@ class EventCreator { let d1 = new Date(container_start.getTime() + start_in_duration) let d2 = new Date(container_start.getTime() + end_in_duration) - /* TODO these writes should preferably be grouped, - to save a redraw for all registered listeners */ - that.ev.setProperty('dtstart', d1); - that.ev.setProperty('dtend', d2); + let type: ical_type = wide_element ? 'date' : 'date-time'; + that.ev.setProperties([ + ['dtstart', d1, type], + ['dtend', d2, type], + ]); // console.log(that.event); // console.log(d1.format("~L~H:~M"), d2.format("~L~H:~M")); |