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

Report Period conditions use timezone offset for Date field types #9805

Closed
ojs87 opened this issue Oct 26, 2022 · 0 comments
Closed

Report Period conditions use timezone offset for Date field types #9805

ojs87 opened this issue Oct 26, 2022 · 0 comments
Labels
Area: Reports Issues & PRs related to all things regarding reports Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Type:Bug Bugs within the core SuiteCRM codebase

Comments

@ojs87
Copy link
Contributor

ojs87 commented Oct 26, 2022

Issue

When a User has set a different timezone and they attempt to report on Date fields, the CRM queries the database using a datetime value with an offset for the timezone. This provides incorrect results as the query will assume a date type has a midnight timestamp.

Expected Behavior

When the the user has set a timezone that is not the same as the database timezone.
The Date Period condition will return the correct results for "Today", "Yesterday" etc

Actual Behavior

When the the user has set a timezone that is not the same as the database timezone.
Date Period conditions of "Yesterday" will return dates from "Today" if the timezone is behind the db timezone.

Possible Fix

If the field type is "datetime" then provide an offset value, else use the midnight value for "date"

Steps to Reproduce

  1. Set your timezone to America/Chicago in your profile.
  2. Create a date field in Contacts
  3. Create a Contacts record with the newly created date field set to today.
  4. Create a Report on Contacts with a condition on the newly created date field equal to the period "Today"
  5. The Contacts record will not be returned in the report

Context

Your Environment

  • SuiteCRM Version used: SuiteCRM 7.12.7
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 105
  • Environment name and version (e.g. MySQL, PHP 7): PHP7.4
  • Operating System and version (e.g Ubuntu 16.04): Ubuntu 20.0.5
ojs87 added a commit to ojs87/SuiteCRM that referenced this issue Oct 26, 2022
@johnM2401 johnM2401 added Type:Bug Bugs within the core SuiteCRM codebase Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Area: Reports Issues & PRs related to all things regarding reports labels Nov 8, 2022
ojs87 added a commit to ojs87/SuiteCRM that referenced this issue Jul 27, 2023
ojs87 added a commit to ojs87/SuiteCRM that referenced this issue Jul 27, 2023
ojs87 added a commit to ojs87/SuiteCRM that referenced this issue Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Reports Issues & PRs related to all things regarding reports Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Type:Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

2 participants