Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Calendar node get:event returns incorrect time for recurring event's nextOccurrence #12262

Open
marcelreschke opened this issue Dec 17, 2024 · 1 comment · May be fixed by #12266
Open
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@marcelreschke
Copy link

Bug Description

When using When retrieving recurring events from Google Calendar, the nextOccurrence field contains incorrect time values. While the date is calculated correctly, the time portion is being set to the current time of execution instead of maintaining the original event's scheduled time.

Current output example:

[
  {
    "kind": "calendar#event",
    // ... redacted ...
    "start": {
      "dateTime": "2023-09-07T09:30:00+02:00",
      "timeZone": "Europe/Berlin"
    },
    "end": {
      "dateTime": "2023-09-07T11:00:00+02:00",
      "timeZone": "Europe/Berlin"
    },
    // ... redacted ...
    "recurrence": [
      "RRULE:FREQ=WEEKLY;UNTIL=20300101T225959Z;BYDAY=TH"
    ],
    // ... redacted ...
    "nextOccurrence": {
      "start": {
        "dateTime": "2024-12-19T08:42:42+00:00",
        "timeZone": "Europe/Berlin"
      },
      "end": {
        "dateTime": "2024-12-19T10:12:42+00:00",
        "timeZone": "Europe/Berlin"
      }
    }
  }
]

To Reproduce

  1. Add Google Calendar.
  2. Connect via OAuth.
  3. Choose Resource: Event, Operation: Get, Calendar ID: your-id, Event ID: your-recurring-event-id.
  4. Test step.

Expected behavior

The nextOccurrence datetime should retain the original event's time part, adjusted to the next occurrence date.

Expected output example:

[
  {
    "kind": "calendar#event",
    // ... redacted ...
    "start": {
      "dateTime": "2023-09-07T09:30:00+02:00",
      "timeZone": "Europe/Berlin"
    },
    "end": {
      "dateTime": "2023-09-07T11:00:00+02:00",
      "timeZone": "Europe/Berlin"
    },
    // ... redacted ...
    "recurrence": [
      "RRULE:FREQ=WEEKLY;UNTIL=20300101T225959Z;BYDAY=TH"
    ],
    // ... redacted ...
    "nextOccurrence": {
      "start": {
        "dateTime": "2024-12-19T09:30:00+02:00",
        "timeZone": "Europe/Berlin"
      },
      "end": {
        "dateTime": "2024-12-19T11:00:00+02:00",
        "timeZone": "Europe/Berlin"
      }
    }
  }
]

Operating System

Alpine Linux 3.20.3

n8n Version

1.69.2

Node.js Version

v20.18.0

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Dec 17, 2024

Hey @marcelreschke,

We have created an internal ticket to look into this which we will be tracking as "N8N-7981"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
2 participants