Explorar el Código

Merge branch 'ical-description' of https://github.com/k-cybulski/fullcalendar

Adam Shaw hace 4 años
padre
commit
f52632a426
Se han modificado 1 ficheros con 14 adiciones y 2 borrados
  1. 14 2
      packages/icalendar/src/main.ts

+ 14 - 2
packages/icalendar/src/main.ts

@@ -147,7 +147,7 @@ function expandICalEvents(iCalEvents: ICAL.Event[], range: DateRange): EventInpu
 
 function buildSingleEvent(iCalEvent: ICAL.Event): EventInput {
   return {
-    title: iCalEvent.summary,
+    ...buildNonDateProps(iCalEvent),
     start: iCalEvent.startDate.toString(),
     end: (specifiesEnd(iCalEvent) && iCalEvent.endDate)
       ? iCalEvent.endDate.toString()
@@ -184,7 +184,7 @@ function expandRecurringEvent(iCalEvent: ICAL.Event, range: DateRange): EventInp
       break
     } else if ((endDate || startDate) > rangeStart.valueOf()) { // is event's end after the range's start?
       eventInputs.push({
-        title: iCalEvent.summary,
+        ...buildNonDateProps(iCalEvent),
         start: startDateTime.toString(),
         end: endDateTime ? endDateTime.toString() : null,
       })
@@ -194,6 +194,18 @@ function expandRecurringEvent(iCalEvent: ICAL.Event, range: DateRange): EventInp
   return eventInputs
 }
 
+function buildNonDateProps(iCalEvent: ICAL.Event): EventInput {
+  return {
+    title: iCalEvent.summary,
+    url: iCalEvent.url,
+    extendedProps: {
+      location: iCalEvent.location,
+      organizer: iCalEvent.organizer,
+      description: iCalEvent.description,
+    }
+  }
+}
+
 function specifiesEnd(iCalEvent: ICAL.Event) {
   return Boolean(iCalEvent.component.getFirstProperty('dtend')) ||
     Boolean(iCalEvent.component.getFirstProperty('duration'))