Skip to content

[BUG] Add to Calendar" Button on My Bookings Page Navigates to google.com Instead of Google Calendar #51

Description

@OmanshiRaj

Describe the Bug

The "📅 Add to Calendar" button rendered on every booking card inside the /my-bookings dashboard does not open Google Calendar. Clicking it navigates the user to the generic google.com homepage in a new tab. The pre-filled event details (title, date, location, description) are completely lost because the URL is malformed — the wrong base domain is used and the query string is assembled incorrectly.


To Reproduce

  1. Go to /my-bookings
  2. Enter a valid registered email address and click "View My Bookings"
  3. Wait for the booking cards to load
  4. Click the "📅 Add to Calendar" button on any booking card
  5. Observe that a new tab opens to google.com homepage — no calendar event is created

Expected Behavior

Clicking "📅 Add to Calendar" should open a new tab to https://calendar.google.com/calendar/render?action=TEMPLATE with the event's title, date/time range, location, and description pre-populated in the Google Calendar "New Event" creation form. The user should be able to click "Save" inside Google Calendar to add the event to their personal calendar without any manual re-entry.


Root Cause (for contributors)

The generateGoogleCalendarLink helper function inside app/my-bookings/page.tsx has two mistakes:

// Current (broken) — line ~42 in app/my-bookings/page.tsx
const baseUrl = 'https://google.com';
return `${baseUrl}&text=${text}&dates=${dates}&details=${details}&location=${location}`;
//              ↑ wrong domain   ↑ & should be ? for the first query param

The correct Google Calendar deep-link base is:
https://calendar.google.com/calendar/render?action=TEMPLATE

Since ?action=TEMPLATE is already part of the base string, all subsequent parameters should be appended with &.


Screenshots/Gifs

No screenshot needed — the issue is fully reproducible by clicking the button; it opens google.com homepage instead of calendar.google.com.


Environment

  • OS: Any (macOS, Windows, Linux)
  • Browser: Any (Chrome, Firefox, Safari — issue is in the URL string, not browser-specific)
  • Node Version: 20.x or higher
  • Next.js: 16.1.3
  • React: 19.2.3

Metadata

Metadata

Assignees

Labels

MediumSSoC26TO CONTRIBUTEbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions