DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,155 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
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)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.