Fix user time zone issue with reminder datetime. Fix for #766. #969
+7
−5
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.
Reminders for Calls and Meetings do not work correctly unless the user’s time zone is set to UTC. If the user’s time zone is set to say Europe (UTC+1) the reminder will trigger 1 hour later.
This was introduced as part of the Reminder enhancements for 7.4.3. It looks like code was copied from include/javascript/jsAlerts.php to modules/Reminders/Reminder.php, however the code in jsAlerts queried Call reminder datetime directly from the database using a query and thus the datetime returned was in UTC, whereas in Reminder.php the query was changed to use the Bean which returns time in the user’s time zone.
The checks performed against the current time were using nowDb() which returns UTC times. This fix changes to check against current time in the user’s time zone.
Originally found this issue in 7.4.3 and then upgraded to 7.5.1 and it was still present. It is also still present in the hotfix branch. This fix will work both releases and the hotfix branch. I am currently running 7.4.3 and have verified that it works. I have also testing in 7.5.1 and hotfix.
This also addresses #811 and #822.