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] Sort by time order incorrect #15078

Closed
xingyaoc-1999 opened this issue Oct 24, 2024 · 3 comments
Closed

[data grid] Sort by time order incorrect #15078

xingyaoc-1999 opened this issue Oct 24, 2024 · 3 comments
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Sorting Related to the data grid Sorting feature

Comments

@xingyaoc-1999
Copy link

xingyaoc-1999 commented Oct 24, 2024

Steps to reproduce

Link to live example: (required)
IMG_20241024_112705

Steps:
1.create two data with time as 2024-10-23T07:28:44.436Z and 2024-10-09T06:04:46.000Z
2.order the data by time
3. find the order is wrong

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: order time

@xingyaoc-1999 xingyaoc-1999 added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 24, 2024
@github-actions github-actions bot added the component: data grid This is the name of the generic UI component, not the React module! label Oct 24, 2024
@KenanYusuf KenanYusuf changed the title orderByTime [data grid] Sort data by time order incorrect Oct 24, 2024
@KenanYusuf KenanYusuf changed the title [data grid] Sort data by time order incorrect [data grid] Sort by time order incorrect Oct 24, 2024
@KenanYusuf KenanYusuf added the feature: Sorting Related to the data grid Sorting feature label Oct 24, 2024
@KenanYusuf
Copy link
Contributor

Hi @xingyaoc-1999 please can you provide a reproduction? You can fork a CodeSandbox/StackBlitz demo from the demos on the docs https://mui.com/x/react-data-grid/sorting/

@KenanYusuf KenanYusuf added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 24, 2024
@xingyaoc-1999
Copy link
Author

I found the problem. It is not possible to convert a date to a string in the valueGetter, it needs to be done in the valueFormatter.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Oct 25, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@xingyaoc-1999 How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@github-actions github-actions bot removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Sorting Related to the data grid Sorting feature
Projects
None yet
Development

No branches or pull requests

2 participants