Skip to content
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

feat(utilities/date-and-time/relative): add localization for "just now" #17878

Conversation

janhassel
Copy link
Member

Localizes the "just now" variant for relative time formats occurring when an event has happened <=59s ago. The reference (en-US) wis changed to "now" as this allows us to utilize the Internationalization API for translating into other locales.

Changelog

Changed

  • If an event has happened <=59s ago, use a relative formatter set up with numeric: 'auto' and pretend the event happened 0 seconds ago to return the localized "now" string.
    • Added test for this case

Removed

  • Unnecessary npm scripts in packages/utilities and packages/utilities-react

@janhassel janhassel requested a review from a team as a code owner October 25, 2024 08:33
Copy link

netlify bot commented Oct 25, 2024

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit afde1fe
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/673da7f304b7a40008eb8575
😎 Deploy Preview https://deploy-preview-17878--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 25, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit afde1fe
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/673da7f3b9d211000861b59f
😎 Deploy Preview https://deploy-preview-17878--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 25, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit afde1fe
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/673da7f304b7a40008eb8573
😎 Deploy Preview https://deploy-preview-17878--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.21%. Comparing base (a968944) to head (afde1fe).
Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17878   +/-   ##
=======================================
  Coverage   82.21%   82.21%           
=======================================
  Files         404      404           
  Lines       14200    14200           
  Branches     4509     4459   -50     
=======================================
  Hits        11674    11674           
- Misses       2363     2364    +1     
+ Partials      163      162    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Member

@ariellalgilmore ariellalgilmore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tay1orjones tay1orjones added this pull request to the merge queue Nov 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 20, 2024
@tay1orjones tay1orjones added this pull request to the merge queue Nov 20, 2024
Merged via the queue into carbon-design-system:main with commit c0450ce Nov 20, 2024
40 checks passed
@carbon-automation
Copy link
Contributor

Hey there! v11.71.0 was just released that references this issue/PR.

@janhassel janhassel deleted the utilities-datetimeformat-relative-justnow branch November 21, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants