-
Notifications
You must be signed in to change notification settings - Fork 146
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
fix(NotificationsPanel): new date-time formatting function #6904
base: main
Are you sure you want to change the base?
fix(NotificationsPanel): new date-time formatting function #6904
Conversation
✅ Deploy Preview for ibm-products-web-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-for-ibm-products ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6904 +/- ##
==========================================
+ Coverage 81.56% 81.70% +0.13%
==========================================
Files 403 402 -1
Lines 13050 12991 -59
Branches 4297 4267 -30
==========================================
- Hits 10644 10614 -30
+ Misses 2406 2377 -29
|
@@ -68,6 +68,7 @@ | |||
"vite": "^6.0.7" | |||
}, | |||
"dependencies": { | |||
"@carbon/utilities": "^0.4.0", |
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.
Since this is being used by the actual NotificationsPanel
component, we would need to move this into the packages/ibm-products/package.json
.
However, re-reading the original issue, it looks like we actually intended for the user to use dateTimeFormat
, which means we would probably want to use the utility in the data or story rather than in the component itself.
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.
I think our intention was to introduce a new timeAgoText
prop and deprecating but not removing the existing props. Since we’re in a major version, we don’t want to remove functionality that could break for adopters when they update to the latest version. Deprecation first is the softer approach and allows us to direct adopters to the new recommended implementation.
You can see an example of how we’ve previously deprecated props here.
Put into draft mode. After further discussion, there are still open questions on how to deprecate the old props gracefully. We can keep the old props, mark them as deprecated, and remove the But, if the app developer was providing translations using the old props, these will now only render the default English, since the old functionality has been removed. For the app developer to specify other languages, they will need to know to use the new |
Closes #6761
Introduced new Carbon utilities dateTimeFormat() function, which follows official date and time and language guidance.
dateTimeFormat()
and 2 new props replaces:What did you change?
Deleted bespoke code.
Added
@carbon/utilities
.How did you test and verify your work?