All-day events don't populate as expected to Google Calendar

Created on 27 June 2025, 6 days ago

Problem/motivation

Links to add an all-day event to a Google Calendar open in Google with a time of 12:00am for both the start and the end, on the same day.

Steps to reproduce

  1. Use this augmenter on an entity that is all day
  2. Click on the Google link
  3. Observe that the "all day" checkbox is not checked, and times of 12:00am are visible for both the start and end

Proposed resolution

The link as rendered by this module looks like:
https://calendar.google.com/calendar/render?action=TEMPLATE&ctz=America%2FToronto&text=SW+Ontario+Drupal+Camp+2025&dates=20251107T000000%2F20251107T000000&location=Waterloo%2C+ON

According to this thread the link should look like this instead:
https://calendar.google.com/calendar/render?action=TEMPLATE&ctz=America%2FToronto&text=SW+Ontario+Drupal+Camp+2025&dates=20251107%2F20251108&location=Waterloo%2C+ON

I have tested the link above and can verify that it works as expected. The thread mentioned that for a one-day, all day event, you should repeat start date as the end, but for multi-day events put in the day at which the event ends, for which midnight is the start of the day. In the thread they refer to this as "adding an extra day", but for the sake of Smart Date values it just means adding a minute to the end value.

I also verified that for a one day event, having the start day and the day after as the end (both without times) works as expected, so I think this approach would work for any value.

This module uses Gitlab CI for automated testing of proposed code changes. To contribute code changes, create a merge request. Patch files will not trigger automated testing and are not sufficient for review.
πŸ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada mandclu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mandclu
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    I can confirm the behavioral difference between the two links reported above. The proposed resolution makes sense to me and does not seem to carry a risk of unexpected consequences.

  • πŸ‡¨πŸ‡¦Canada mandclu

    After some additional testing, it turns out that the previously cited issue about all day events including times was specific to core date fields, and is actually an upstream bug with Smart Date. It has been fixed in πŸ› Core date-only fields should always show as all day Active .

    Updating this issue to focus on "adding one day", which still needs to be fixed here.

  • Merge request !30Add one day to the end of all day events β†’ (Open) created by mandclu
  • πŸ‡¨πŸ‡¦Canada mandclu

    The change actually broke the all day tests, so I updated the test. I verified that core date-only ranges store the start and end as the same value for single-day events, so the upside is that the test data now matches that.

    I also left one test with different start and end dates, but updated the expected markup to reflect a two-day event. I thought it made sense to have test coverage of a multi-day event.

    I've manually verified the updated links in Google and Apple Calendar, but still need to verify them with Outlook.

  • πŸ‡¨πŸ‡¦Canada mandclu

    Adding a patch for composer patching

Production build 0.71.5 2024