-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove formatWithoutParsing
function and replace it with formatDate
#7395
Conversation
data-hub-frontend Run #58025
Run Properties:
|
Project |
data-hub-frontend
|
Branch Review |
fix/remove-format-without-parsing
|
Run status |
Passed #58025
|
Run duration | 01m 39s |
Commit |
319075ac04: PR refinements
|
Committer | Paul Gain |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
15
|
View all changes introduced in this branch ↗︎ |
1f2ccc7
to
cf0a0a0
Compare
cf0a0a0
to
547e907
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7395 +/- ##
==========================================
+ Coverage 88.01% 88.18% +0.17%
==========================================
Files 1167 1168 +1
Lines 18139 18132 -7
Branches 5136 5127 -9
==========================================
+ Hits 15965 15990 +25
+ Misses 2174 2142 -32 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I left a number of suggestions:
- The ergonomics of
formatDate
could be greatly improved if the format presets were a map and we leveraged TypeScript in JSDoc - I wouldn't use
formatDate
in test assertions
Approving it anyway as I don't wanna block it while I'm gonna be off for until new year.
src/client/components/InvestmentReminders/OutstandingPropositions.jsx
Outdated
Show resolved
Hide resolved
src/client/components/MyInvestmentProjects/InvestmentEstimatedLandDate.jsx
Outdated
Show resolved
Hide resolved
…out-parsing generated from commit 79df8cb
Description of change
This PR simplifies the use of date utilities by replacing all instances of
formatWithoutParsing
withformatDate
. Importantly, it introduces the practice of importingdate-fns
functions directly in source files, bypassing the centraliseddate.js
module. This change reduces the reliance on redundant wrappers like those indate.js
, making the codebase cleaner and more maintainable. In a subsequent PR, the remainingdate.js
wrappers and imports fromdate-fns
will be removed entirely.Checklist