-
-
Notifications
You must be signed in to change notification settings - Fork 731
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
Adopt date-fns to format and manipulate dates #342
Comments
@gpbl can you make this time library agnositic, we migrated away from moment to js-joda.github.io and it has splendid support for all the date/time functions you will ever need. If somehow react-day-picker can be modular to support any time library, we would appreciate it. |
@r-tock thanks for your feedback. date-fns seems modular enough so it shouldn't add much weight to the final bundle. I'll do my tests to see how it works first, but it seems i can just replace the original utils with some of theirs. |
So far there are two missing pieces from date-fns:
|
@gpbl hello, thank you for trying date-fns :-)
We will release an alpha very soon. Stable version will be released after all locales are converted for v2. Is there something I can do to help your library adopt date-fns? |
@leshakoss thanks from dropping by and share the positive news. Eager to try the alpha version and see how it works with the component. |
Another thing is that we may want to support UTC and date-fns still doesn't work with them. So, the initial idea to fix timezone issues with date-fns may not be right until that issue is closed as well. |
Guys, your collaboration is pretty awesome 🔥 |
I'd love to see this happen. |
Luxon is working great with UTC! Browser support is a bit iffy, depending on your needs. |
An update. We are not going to use |
When I first wrote this component, moment.js was the only good library to work with
Date
objects – but being its size so big I preferred to keep this package without depending on it (one of the reasons I made this component was that the available date picker were always requiring moment.js). But working with Date objects in javascript is not easy at all, and maintaining my own Dates manipulation library requires some effort.Now we have date-fns: it is modular like lodash so I expect it that adopting it would not increase so much the size of this module. Adopting date-fns would have many benefits:
Similar discussion: react-dates/react-dates#208
The text was updated successfully, but these errors were encountered: