Skip to content

Request: Possible to store custom data inside calendar events? #1456

@pasmai

Description

@pasmai

Is it possible to store custom data inside a calendar event?

  const onBeforeCreateEvent: ExternalEventTypes["beforeCreateEvent"] = (
    eventData
  ) => {
    const event = {
      calendarId: eventData.calendarId || "",
      id: String(Math.random()),
      title: eventData.title,
      isAllday: eventData.isAllday,
      start: eventData.start,
      end: eventData.end,
      category: eventData.isAllday ? "allday" : "time",
      dueDateClass: "",
      location: eventData.location,
      state: eventData.state,
      isPrivate: eventData.isPrivate,
      raw: "only thing that gets stored",
      extraField1: "more data here",
      extraField2: "even more!",
    };

    getCalInstance().createEvents([event]);
  };
  
    const onClickEvent: ExternalEventTypes["clickEvent"] = (res) => {
    console.log("Event Info : ", res.event);
  };


<Calendar 
        onClickEvent={onClickEvent}
        onBeforeCreateEvent={onBeforeCreateEvent}
/>

Expected Behavior

I would expect to be able to add custom fields to my calendar event object and also have them be stored.
I know that there is a raw field, but apart from that, any other data I set on the event does not seem to be saved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions