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

[Field formatters] Time suffix for duration formatter #76729

Merged
merged 4 commits into from
Sep 8, 2020

Conversation

wylieconlon
Copy link
Contributor

@wylieconlon wylieconlon commented Sep 3, 2020

Users who don't set up the duration formatter are often confused by the units represented by the number, so adding a suffix is the easiest way to indicate the unit. Originally I considered adding abbreviated suffixes such as ms and s, but instead I'm reusing the existing existing text labels for duration. The possible suffixes are translated. In English they are:

  • Milliseconds
  • Seconds
  • Minutes
  • Hours
  • Days
  • Years

Examples:

Screen Shot 2020-09-03 at 6 18 08 PM

Screen Shot 2020-09-03 at 6 34 49 PM

Closes #72762

Checklist

Delete any items that are not applicable to this PR.

@wylieconlon wylieconlon requested a review from a team as a code owner September 3, 2020 22:37
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@wylieconlon wylieconlon added release_note:enhancement and removed enhancement New value added to drive a business result labels Sep 3, 2020
Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

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

It's been so long since I've touched this code so I don't really feel qualified to review this unless I refresh on how all these things work.

Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

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

code LGTM

@wylieconlon
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

page load bundle size

id value diff baseline
data 1.4MB +209.0B 1.4MB
indexPatternManagement 136.0KB +647.0B 135.4KB
total +856.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

Code looks good, runs well too.

@wylieconlon wylieconlon merged commit 02233e7 into elastic:master Sep 8, 2020
@wylieconlon wylieconlon deleted the duration-suffix branch September 8, 2020 20:53
wylieconlon pushed a commit that referenced this pull request Sep 8, 2020
* [Field formatters] Time suffix for duration formatter

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
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.

[Field formatters] Duration formatter should have an option to add suffixes to time
6 participants