DEV Community

MOHSIN ALI SOOMRO
MOHSIN ALI SOOMRO

Posted on

Add Event to the google calender

import makeUrl from "add-event-to-calendar";

export default function App() {
  const sendEventToCalender = () => {
    const event = makeUrl({
      name: `Event name`,
      location: "Event location",
      details: `Event details`,
      startsAt: new Date().toString(),
      endsAt: new Date().toString()
    });
    console.log(event);
    window.open(event.google, "_blank");
  };

  return (
    <div className="App">
      <h1>Hello CodeSandbox</h1>
      <h2>Start editing to see some magic happen!</h2>
      <button onClick={sendEventToCalender}>Make urls</button>
    </div>
  );
}

Enter fullscreen mode Exit fullscreen mode

👉 codesandbox

Top comments (0)