trex
trex copied to clipboard
Replace `moment` with `date-fns`
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:
- [x] replace
moment
occurrences withdate-fns
inextension
- [ ] replace
moment
occurrences withdate-fns
inyttrex
- [x] replace
moment
occurrences withdate-fns
inguardoni
- [x] replace
moment
occurrences withdate-fns
inycai
- [ ] replace
moment
occurrences withdate-fns
intktrex
- [ ] remove
moment
from every workspacepackage.json
moment
is often used for:
-
moment.duration
(measure the distance between two times and return an humanized version) -
moment.add
/moment.subtract
-
moment.isBefore
/moment.isAfter
are there functionalities supported by date-fns
?
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.