React-datepicker: Replace Moment with date-fns

Created on 21 Nov 2018  路  4Comments  路  Source: Hacker0x01/react-datepicker

The problem with Moment is that it has a big size in bundles. Date-fns was created to mitigate that problem by allowing better tree shaking. Suggestion: replace moment with date-fns.

Most helpful comment

In our project, we use Moment.js extensively. Changing Moment.js to Date-fns in react-datepicker only adds up to the application footprint. Is it possible to make it a drop-in dependency, so we could use new version of this great component and keep Moment.js without replacing it with date-fns, or adding another dependency and making overall application bundle even bigger than before?

All 4 comments

Moment was removed in v2.0.0. This should resolve your concerns,

Thank you :-)!

In our project, we use Moment.js extensively. Changing Moment.js to Date-fns in react-datepicker only adds up to the application footprint. Is it possible to make it a drop-in dependency, so we could use new version of this great component and keep Moment.js without replacing it with date-fns, or adding another dependency and making overall application bundle even bigger than before?

I'm happy to support that path if you can help to get there. Ideally, the datepicker would support multiple date engines so you can use the date engine that works best with the rest of your app.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pinturic picture pinturic  路  3Comments

jcabrerazuniga picture jcabrerazuniga  路  3Comments

lclemence picture lclemence  路  3Comments

ali-master picture ali-master  路  3Comments

jbccollins picture jbccollins  路  3Comments