fix: timezone handling in calendar reminders#209
Open
quantbitrealmSimon wants to merge 145 commits intoTeamNovaSoft:mainfrom
Open
fix: timezone handling in calendar reminders#209quantbitrealmSimon wants to merge 145 commits intoTeamNovaSoft:mainfrom
quantbitrealmSimon wants to merge 145 commits intoTeamNovaSoft:mainfrom
Conversation
….com/TeamNovaSoft/discord-bot into feat/iss-137/action-all-contributors
….com/TeamNovaSoft/discord-bot into feat/iss-137/action-all-contributors
….com/TeamNovaSoft/discord-bot into feat/iss-137/action-all-contributors
….com/TeamNovaSoft/discord-bot into feat/iss-137/action-all-contributors
….com/TeamNovaSoft/discord-bot into feat/iss-137/action-all-contributors
….com/TeamNovaSoft/discord-bot into feat/iss-137/action-all-contributors
…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: check assignedTagId value
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
schedule-google-calendar.jsto pass the event timezone todateToCronExpressionschedule-event-reminder.jsto pass timezone parameter through the chaindate-to-cron-expression.jsChanges Made
src/cron/schedule-google-calendar.js: Now passesevent.start.timeZonetodateToCronExpression()src/cron/schedule-event-reminder.js: UpdatedgenerateReminderCronExpression()to accept and pass timezonesrc/utils/date-to-cron-expression.js: Fixed JSDoc for the timezone parametersrc/utils/tests/date-to-cron-expression.test.js: Added comprehensive timezone testsTesting
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