amaannawab923 opened a new pull request, #36270:
URL: https://github.com/apache/superset/pull/36270

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
    Fix: Timezone-related date filter bug in AG Grid Table
   
   ### Summary
   
     Fixes incorrect date filter results in the AG Grid Table chart where users 
in certain timezones received wrong dates when applying temporal filters.
   
     Issue
   
     Users reported that date filters returned incorrect results:
     • Filtering for 08/10/2003 returned 07/10/2003 data
     • Date range filter for 06-09/10/2003 returned 05 and 07/10/2003 instead 
of 06, 07, 08
   
    This issue was reproducible for users in UTC+8, UTC-4, and other non-UTC 
timezones.
   
     Root Cause
   
     This is a known limitation with AG Grid's internal date filter comparator, 
which does not handle timezone conversions correctly when comparing dates 
across different
     timezones. The issue is documented in:
     • https://github.com/ag-grid/ag-grid/issues/8611 • UTC Date Editor Problem
     • https://github.com/ag-grid/ag-grid/issues/3921 • DateFilter timezone 
regression
   
     When data is stored in UTC and users apply filters from a different 
timezone, AG Grid's default comparison logic causes off-by-one day errors due 
to timezone offset
     differences at midnight boundaries.
   
     Solution
   
     Implemented a custom date comparator that normalizes both the filter date 
and cell date to UTC before comparison. This ensures consistent date matching 
regardless of the
     user's local timezone.
   
     The fix extracts the UTC date components from the cell value and compares 
them against the user's selected filter date, eliminating timezone-related 
discrepancies.
   
     Testing
   
     • Verified with multiple timezones (UTC, UTC+8, UTC-4, UTC+5:30)
     • Date equality and range filters now return correct results
     • Edge cases (null values, invalid dates) handled appropriately
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to