Skip to content

fix: timezone handling in calendar reminders#209

Open
quantbitrealmSimon wants to merge 145 commits intoTeamNovaSoft:mainfrom
quantbitrealmSimon:fix/calendar-timezone-reminders
Open

fix: timezone handling in calendar reminders#209
quantbitrealmSimon wants to merge 145 commits intoTeamNovaSoft:mainfrom
quantbitrealmSimon:fix/calendar-timezone-reminders

Conversation

@quantbitrealmSimon
Copy link

Fixes #109

Problem

The calendar reminder was not considering the event timezone when creating cron expressions. This caused reminders to fire at incorrect times when events were created in different timezones than the bot's default timezone.

For example, when a user created a meeting at 1pm Argentina time, the bot would set the reminder for 1pm Colombia time (which is 2 hours later), causing the reminder to fire at the wrong time.

Solution

  • Updated schedule-google-calendar.js to pass the event timezone to dateToCronExpression
  • Updated schedule-event-reminder.js to pass timezone parameter through the chain
  • Fixed JSDoc parameter documentation in date-to-cron-expression.js
  • Added unit tests for timezone conversion scenarios

Changes Made

  • src/cron/schedule-google-calendar.js: Now passes event.start.timeZone to dateToCronExpression()
  • src/cron/schedule-event-reminder.js: Updated generateReminderCronExpression() to accept and pass timezone
  • src/utils/date-to-cron-expression.js: Fixed JSDoc for the timezone parameter
  • src/utils/tests/date-to-cron-expression.test.js: Added comprehensive timezone tests

Testing

The fix ensures that when an event is created at 1pm Argentina time, the reminder correctly fires at 1pm Argentina time, not at the bot's local timezone equivalent.

/claim

joset98 and others added 30 commits March 6, 2025 16:10
joset98 and others added 30 commits March 31, 2025 10:21
…ate-doc-to-github-webhook

Doc/iss 183/create doc to GitHub webhook
…e-user-selector

refactor: improve command flow with user selector
…nedTagId

fix: log ASSIGN_TASK_FORUM env to check values
…stack-assign-task-command

fix: add error stack in object to show in assign task command
…v-proposal-for-point-registration

feat: add proposal
…eminder-is-not-timezone-rebase

Feat/calendar reminder is not timezone rebase
…-section

fix: add default section to show simple descriptions
…l-votation-MessageUpdate

Feat/iss 30/poll votation message update
Fixes TeamNovaSoft#109

The calendar reminder was not considering the event timezone when creating
cron expressions. This caused reminders to fire at incorrect times when
events were in different timezones than the bot's default timezone.

Changes:
- schedule-google-calendar.js: Pass event timezone to dateToCronExpression
- schedule-event-reminder.js: Pass timezone parameter through the chain
- date-to-cron-expression.js: Fix JSDoc parameter documentation
- Added unit tests for timezone conversion scenarios

The fix ensures that when an event is created at 1pm Argentina time,
the reminder correctly fires at 1pm Argentina time, not at 1pm Colombia
time (or whatever the bot's default timezone is).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants