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

[data grid] Wrong date when filtering on date when in timezone GMT - 3 #14970

Open
gustavhagland opened this issue Oct 15, 2024 · 1 comment
Open
Labels
component: data grid This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@gustavhagland
Copy link
Contributor

gustavhagland commented Oct 15, 2024

Steps to reproduce

Link to live example: https://stackblitz.com/edit/react-pfwkpt?file=Demo.tsx

Steps:

  1. Set timezone to GMT - 3 on your local computer
  2. Open the demo and select any date

Current behavior

The date in the filter will be the selected date -1 day at 21:00 in GMT -3

Expected behavior

For the date to be the same date picked in the users current timezone

Context

No response

Your environment

npx @mui/envinfo Using firefox/chromium
    System:
    OS: Linux 6.10 Fedora Linux 40 (Workstation Edition)
  Binaries:
    Node: 20.17.0 - /usr/bin/node
    npm: 10.8.2 - /usr/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: Not Found
  npmPackages:
    @emotion/react: 11.11.4 => 11.11.4
    @emotion/styled: 11.11.5 => 11.11.5
    @mui/base:  5.0.0-beta.40
    @mui/core-downloads-tracker:  5.16.6
    @mui/icons-material: 5.15.14 => 5.15.14
    @mui/lab: 5.0.0-alpha.169 => 5.0.0-alpha.169
    @mui/material: 5.16.6 => 5.16.6
    @mui/private-theming:  5.16.6
    @mui/styled-engine:  5.16.6
    @mui/system:  5.16.6
    @mui/types:  7.2.15
    @mui/utils:  5.16.6
    @mui/x-data-grid:  7.12.0
    @mui/x-data-grid-pro: 7.12.0 => 7.12.0
    @mui/x-date-pickers:  7.12.0
    @mui/x-date-pickers-pro: 7.12.0 => 7.12.0
    @mui/x-internals:  7.12.0
    @mui/x-license:  7.12.0
    @types/react: 18.2.73 => 18.2.73
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
    typescript: 5.4.3 => 5.4.3

Search keywords: filter date
Order ID: 77030

@gustavhagland gustavhagland added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 15, 2024
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Oct 15, 2024
@arminmeh
Copy link
Contributor

@gustavhagland

date filters work with UTC timezone. If you output JSON.stringify(filterModel?.items) or filterModel?.items[0]?.value?.toISOString() you will see the date that you have chosen.

In addition to that, selecting the date correctly filters out the data in the grid

can you give more details for which use case this creates a problem for you?

@arminmeh arminmeh added status: waiting for author Issue with insufficient information and removed bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

No branches or pull requests

2 participants