Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

Replace moment with date-fns #351

Open
3 of 6 tasks
ascariandrea opened this issue Feb 1, 2022 · 2 comments · Fixed by #355
Open
3 of 6 tasks

Replace moment with date-fns #351

ascariandrea opened this issue Feb 1, 2022 · 2 comments · Fixed by #355
Labels
dependencies Pull requests that update a dependency file

Comments

@ascariandrea
Copy link
Collaborator

ascariandrea commented Feb 1, 2022

moment is actually quite heavy and can be easily replaced with date-fns (already in use in the project).
This will consolidate our "date" api and methods. We can also think about creating proper shared utils and helpers usable by every package.

Tasks:

  • replace moment occurrences with date-fns in extension
  • replace moment occurrences with date-fns in yttrex
  • replace moment occurrences with date-fns in guardoni
  • replace moment occurrences with date-fns in ycai
  • replace moment occurrences with date-fns in tktrex
  • remove moment from every workspace package.json
@ascariandrea ascariandrea added the dependencies Pull requests that update a dependency file label Feb 1, 2022
@vecna
Copy link
Member

vecna commented Feb 1, 2022

moment is often used for:

  1. moment.duration (measure the distance between two times and return an humanized version)
  2. moment.add/moment.subtract
  3. moment.isBefore/moment.isAfter

are there functionalities supported by date-fns?

@ascariandrea ascariandrea linked a pull request Feb 2, 2022 that will close this issue
@ascariandrea
Copy link
Collaborator Author

ascariandrea commented Feb 2, 2022

yep @vecna, date-fns provides proper methods to achieve everything you can get with moment.

I opened this PR #355 that shows how can be used for formatting and operate (add/sub) on dates.

vecna added a commit that referenced this issue Aug 12, 2022
vecna added a commit that referenced this issue Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants