Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pasmai opened this issue Jul 11, 2024 · 0 comments
Open

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

pasmai opened this issue Jul 11, 2024 · 0 comments

Comments

@pasmai
Copy link

pasmai commented Jul 11, 2024

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.

@pasmai pasmai changed the title Possible to store custom data inside calendar events? Request: Possible to store custom data inside calendar events? Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant