time-picker icon indicating copy to clipboard operation
time-picker copied to clipboard

Consider switching dependencies from moment.js to date-fns

Open jackpilowsky opened this issue 7 years ago • 4 comments

For me, the amount of size that moment.js adds to my builds is unmanageable. There are other issues:

https://github.com/date-fns/date-fns/issues/275#issuecomment-264934189

Date-fns has some very good endorsements:

https://twitter.com/dan_abramov/status/805030922785525760?lang=en

Would you consider, if I were to submit a pull request to switch the dependency from moment.js to date-fns?

jackpilowsky avatar Oct 27 '18 05:10 jackpilowsky

+1.

dnizetic avatar Oct 19 '19 08:10 dnizetic

I've just migrated the project to date-fns and the native Date type https://github.com/kkomelin/time-picker

  • See what has changed for the end-user here.
  • The Storybook examples work as expected npm start.
  • Most of the automated tests are successful npm test. There are a couple of failed (incorrect values handling).

To play with the project, install it with npm i https://github.com/kkomelin/time-picker

Roadmap

  • [x] Perform migration from Moment.js to date-fns.
  • [ ] https://github.com/date-fns/date-fns/issues/916: Need to find a way to simulate the strict parsing mode of Moment.
  • [ ] Fix failed automated tests (because of the lack of strict parsing mode in date-fns)
  • [ ] Discuss with react-component/time-picker maintainers whether we release a new major version or keep two projects separate.
  • [ ] Depending on the results of the discussion, send PR to react-component/time-picker or release a new project.

I would appreciate your feedback and any help with testing and optimizing the code.

kkomelin avatar Jun 23 '20 18:06 kkomelin

@kkomelin cannot run your fork 😭

behagoras avatar Jul 29 '20 19:07 behagoras

@kkomelin cannot run your fork

@behagoras Why?

kkomelin avatar Jul 30 '20 03:07 kkomelin