Updated to date-fns version two. This was fairly tricky, I'd recommend TDD-ing future date util libraries as it will force simplicity.
A really nice feature of date-fns version 2 is that it stops you handling dates, numbers & strings interchangeably, and forces you to use either dates or numbers. This is much easier to grep, and they provide utility modules to get a dates format in whichever string you like.
The previous code has a hack in, which is to get the first 10 characters of a datestring and use that to get the date. This is not the correct behaviour, as timezones are a thing. I've kept that hack in one place, but have included a small comment for future maintainers.
If this is your first x-dash pull request please familiarise yourself with the contribution guide before submitting.
If you're creating a component:
Add the Component label to this Pull Request
If this will be a long-lived PR, consider using smaller PRs targeting this branch for individual features, so your team can review them without involving x-dash maintainers
If you're using this workflow, create a Label and a Project for your component and ensure all small PRs are attached to them. Add the Project to the Components board
put a link to this Pull Request in the Project description
set the Project to Automated kanban with reviews, but remove the To Do column
If you're not using this workflow, add this Pull Request to the Components board.
Updated to date-fns version two. This was fairly tricky, I'd recommend TDD-ing future date util libraries as it will force simplicity.
A really nice feature of date-fns version 2 is that it stops you handling dates, numbers & strings interchangeably, and forces you to use either dates or numbers. This is much easier to grep, and they provide utility modules to get a dates format in whichever string you like.
The previous code has a hack in, which is to get the first 10 characters of a datestring and use that to get the date. This is not the correct behaviour, as timezones are a thing. I've kept that hack in one place, but have included a small comment for future maintainers.
If this is your first
x-dash
pull request please familiarise yourself with the contribution guide before submitting.If you're creating a component:
Component
label to this Pull RequestAutomated kanban with reviews
, but remove theTo Do
column