DEV Community

MOHSIN ALI SOOMRO
MOHSIN ALI SOOMRO

Posted on

3 2

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)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay