-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
refactor: replace momentjs in desktop #8959
refactor: replace momentjs in desktop #8959
Conversation
Thanks for taking the time to open a PR!
|
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.
Thanks for the work! This is really helpful towards replacing moment.js overall. 💯
cy.get('@firstRunRow').contains('24:47') | ||
cy.get('.runs-container li').eq(3).contains('45:47') | ||
cy.get('@firstRunRow').contains('12:24:47') | ||
cy.get('@fourthRunRow').contains('12:45:47') |
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.
This is what the full value always was - before the changes in this branch.
@@ -1,6 +1,31 @@ | |||
import _ from 'lodash' | |||
import gravatar from 'gravatar' | |||
import duration from '../../../server/lib/util/duration' |
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.
yah, it would be nice to sync this back with the server after it's updated to remove moment.js also
User facing changelog
Replaced momentjs dependency in desktop application
Additional details
Used dayjs to replace the few momentjs functions used in the desktop app. Tried date-fns first but dayjs much more closely follows the momentjs api. Also the locale options for date-fns regarding formatting durations differed a bit. Some of the dates were formatted by a function imported from the server package, I left that intact and just created a similar function using dayjs in this package.
Also added an extra test for the
getFormattedTimeFromNow
method, I started by adding more test cases (e.g. 44 seconds, 45 seconds, ...) but then it just felt like I was testing the dayjs functionality so I only kept 1 case.How has the user experience changed?
N/A
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?