Move the creating event from calendar to one place.

master
Tom Hacohen 7 years ago
parent 03bbc7af17
commit 0fb37c1132

@ -51,7 +51,7 @@ class JournalEntries extends React.Component {
let name;
let uid;
if (comp.name === 'vcalendar') {
const vevent = new EventType(comp.getFirstSubcomponent('vevent'));
const vevent = EventType.fromVCalendar(comp);
name = vevent.summary;
uid = vevent.uid;
} else if (comp.name === 'vcard') {

@ -50,7 +50,7 @@ export function syncEntriesToCalendarItemMap(collection: EteSync.CollectionInfo,
const color = colorIntToHtml(collection.color);
for (const syncEntry of entries) {
let comp = new EventType(new ICAL.Component(ICAL.parse(syncEntry.content)).getFirstSubcomponent('vevent'));
let comp = EventType.fromVCalendar(new ICAL.Component(ICAL.parse(syncEntry.content)));
if (comp === null) {
continue;

@ -14,6 +14,10 @@ export class EventType extends ICAL.Event {
get end() {
return this.endDate.toJSDate();
}
static fromVCalendar(comp: ICAL.Component) {
return new EventType(comp.getFirstSubcomponent('vevent'));
}
}
export class ContactType {

Loading…
Cancel
Save