material-table-core / core

Datatable for React based on material-ui's table with additional features. Support us at https://opencollective.com/material-table-core
https://material-table-core.github.io
MIT License
296 stars 146 forks source link

date-fns V3 and material-table 6.4.1 throws parseISO error when a column has a type of "date"/"datetime" #838

Closed ShotSkydiver closed 6 months ago

ShotSkydiver commented 7 months ago

Guidelines

When I updated material-table to the latest 6.4.1, and updated date-fns to its latest version, 3.6.0, my React app crashes when a table column has the type of "date" or "datetime", with this error: (0, _parseISO["default"]) is not a function. (In '(0, _parseISO["default"])(props.value)', '(0, _parseISO["default"])' is an instance of Object)

OS: macOS Browser: Safari Version: 17.5

Domino987 commented 7 months ago

Hi, can you add a sandbox with your minimal reproducible example? Ty

TheWeirdDev commented 6 months ago

I have the same issue. According to the date-fns documentation this line should be changed from:

import parseISO from 'date-fns/parseISO';

to

import { parseISO } from 'date-fns';
Domino987 commented 6 months ago

Would you mind creating a PR for this?

TheWeirdDev commented 6 months ago

Sure