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
problem with date-fns #240
Comments
You need date fns 2.0 |
@dmtrKovalenko Please add |
@dmtrKovalenko Why not add date-fns as a peer dependency? At least then yarn would complain. |
@andrew-w-ross Because we have a dependency moment OR date-fns |
@dmtrKovalenko Thank you for added in docs |
Still won't work: import error: 'DateFnsUtils' is not exported from 'date-fns'. Please add document about how to use date-fns with @material-ui/pickers Also, since moment won't work with @material-ui/pickers, why not just add date-fns into the package itself. |
You need to install both
|
@aeroxy I'll try to describe everything
|
I see. But this is confusing. Why not just, again, add date-fns into the package itself. You can add another npm package called |
Yeah I don't really get the thinking behind having the provider in general. Having to wrap everything in |
We got bit by this. We lost considerable time trying to understand the My team and I are in full support of @aeroxy 's suggestion. |
We will not get out of current solution at least for now |
Environment
Steps to reproduce
date-fns have folder like
add_days
Expected behavior
import parse from 'date-fns/parse';
import addDays from 'date-fns/add_days';
import addMonths from 'date-fns/add_months';
import addYears from 'date-fns/add_years';
import endOfDay from 'date-fns/end_of_day';
import endOfMonth from 'date-fns/end_of_month';
import endOfWeek from 'date-fns/end_of_week';
import endOfYear from 'date-fns/end_of_year';
import format from 'date-fns/format';
import isAfter from 'date-fns/is_after';
import isBefore from 'date-fns/is_before';
import isSameDay from 'date-fns/is_same_day';
import isValid from 'date-fns/is_valid';
import setDay from 'date-fns/set_day';
import setHours from 'date-fns/set_hours';
import setMinutes from 'date-fns/set_minutes';
import setYear from 'date-fns/set_year';
import startOfDay from 'date-fns/start_of_day';
import startOfMonth from 'date-fns/start_of_month';
import startOfWeek from 'date-fns/start_of_week';
import startOfYear from 'date-fns/start_of_year';
import getHours from 'date-fns/get_hours';
import getYear from 'date-fns/get_year';
import isEqual from 'date-fns/is_equal';
Actual behavior
import parse from 'date-fns/parse';
import addDays from 'date-fns/addDays';
import addMonths from 'date-fns/addMonths';
import addYears from 'date-fns/addYears';
import endOfDay from 'date-fns/endOfDay';
import endOfMonth from 'date-fns/endOfMonth';
import endOfWeek from 'date-fns/endOfWeek';
import endOfYear from 'date-fns/endOfYear';
import format from 'date-fns/format';
import isAfter from 'date-fns/isAfter';
import isBefore from 'date-fns/isBefore';
import isSameDay from 'date-fns/isSameDay';
import isValid from 'date-fns/isValid';
import setDay from 'date-fns/setDay';
import setHours from 'date-fns/setHours';
import setMinutes from 'date-fns/setMinutes';
import setYear from 'date-fns/setYear';
import startOfDay from 'date-fns/startOfDay';
import startOfMonth from 'date-fns/startOfMonth';
import startOfWeek from 'date-fns/startOfWeek';
import startOfYear from 'date-fns/startOfYear';
import getHours from 'date-fns/getHours';
import getYear from 'date-fns/getYear';
import isEqual from 'date-fns/isEqual';
and now get a new error
The text was updated successfully, but these errors were encountered: