-
Notifications
You must be signed in to change notification settings - Fork 832
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
Migrate to date-fns or luxon? #61
Comments
We're using moment basically for timezone calculations with moment-timezone atm., still i'd like to completely migrate away from moment due to size implications. Besides missing time-zone support there are also a lot less languages supported in date-fns as in moment (https://github.com/moment/moment/tree/develop/locale vs https://github.com/date-fns/date-fns/blob/master/docs/i18n.md). My take on this would be to wait till date-fns 2 reaches at least beta and then look into refactoring. A lot of things should be easy to refactor - the one thing which may require breaking changes is then handling of locales though. If i get it correctly date-fns is stateless so you have to pass the locale to every function which is locale aware. |
At its current size moment is an all but dead library. |
@sakulstra @mduijn What did you think about luxon? |
not sure, tbh. I heard of it the first time ~5days ago and didn't use/test it at all. Eventually it would also make sense to reevaluate if we could just get away with the native Date and rip out the 3th party date libraries. Then users could just decide themselves if/what library they use. Personally i would just let it like it is for now and rethink later in a few months. |
Honestly I'm using only Recently |
+1 for migrating off of |
+1 for migrating to date-fns. This is the main reason we do not use this date picker right now |
@cherniavskii @alitaheri |
@dmtrKovalenko That sounds great 👍 👍 Just keep in mind, not everything has been moved to utils, which is easy to solve 😁 Also, we should come up with a solution for interoperability. I think we should accept only ISO strings to make sure every implementation can know what to do. |
@alitaheri Maybe there is a way to allow passing any, to add ability pass library-specific date object? |
@dmtrKovalenko Oh... right, you're right 👍 👍 |
@dmtrKovalenko good idea! |
@cherniavskii I think it should be required, we can do utils with vanilla date by default, but it can take some unused code, if somebody doesnt using tree shaking, I think it should throw some error if no utils passed. |
So creating a single picker will require to import appropriate utils and pass them to picker? |
Why not, we can also pass the vanilla utils by default, I think everybody using shared components to use pickers, so it would not be a problem? Or would be? |
@dmtrKovalenko I would go with forcing utils to be specified. It's not a big deal. and can some a lot of people a lot of hassle, reduce the lib size and a lot more. We're in beta, so breaking changes are expected anyway. 👍 For externalizing utils and forcing others to require the utils of their choice. |
@dmtrKovalenko I just wanted to make sure I understood your idea right ;) |
+1 for abandoning moment. Native date is better in the long run, but if a library has to be used, then definitely date-fns. We use it in place of moment wherever we can. |
I would vote for Intl.js to be as close to native as possible - if a dep. should be used, then one as small as posible. This was also the case for the built-in datepicker in [email protected]. |
count me in for date-fns |
+1 for date-fns |
Would really love to see date-fns! |
I am using date-fns as well in my project. This picker is the only reason to add moment in my project. Would love to move away from that dependency. |
+1 for date-fns |
@ALL guys, we have added that in v1.0.0-rc.1 |
This has been closed, but I want to ask nevertheless. https://github.com/lookapanda/material-ui-pickers/blob/luxon/lib/src/utils/luxon-utils.js If there is interest, I could do a PR. |
@lookapanda wow, that's cool, I think we can add Luxon support :) |
@lookapanda Way to go! |
We have moved moment to the peer deps, and now I am considering about replacing moment at all with date-fns. 😎
So this just issue to consider if there are many people that using moment with this project?
How many people using date-fns?
I am just need to realize which way would be more convenient. ❓
The text was updated successfully, but these errors were encountered: