Skip to content

Adopt date-fns to format and manipulate dates #342

@gpbl

Description

@gpbl

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:

  • finally fix long standing issues with timezones for some edge cases (need UTC functions date-fns/date-fns#376 closed)
  • we won't need to change the date to 12AM to workaround such issues (need UTC functions date-fns/date-fns#376 closed)
  • react-day-picker would have built-in support for i18n (wait for date-fns v2)
  • we can remove the required moment.js support from the input component
  • we would push js community away from moment.js and adopt this better date library

Similar discussion: react-dates/react-dates#208

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions