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

Updated timeago strings #4012

Merged
merged 2 commits into from
Jul 29, 2019
Merged

Updated timeago strings #4012

merged 2 commits into from
Jul 29, 2019

Conversation

ranbena
Copy link
Contributor

@ranbena ranbena commented Jul 27, 2019

  • Refactor

Description

  1. "a few seconds ago" is too common to be so long. "just now" is better.
  2. Sometimes differences in server/client clocks cause the confusing "in a few seconds". Now will simply say "just now".
  3. Updated the tooltip to ant design.

This also manifests to "Outdated Queries", "Users" list and "Alerts" list.

Mobile & Desktop Screenshots

Before After
Screen Shot 2019-07-27 at 16 42 27 Screen Shot 2019-07-27 at 16 40 41

@ranbena ranbena self-assigned this Jul 27, 2019
@ranbena ranbena requested a review from arikfr July 27, 2019 13:53
Copy link
Member

@arikfr arikfr left a comment

Choose a reason for hiding this comment

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

👍

@@ -6,6 +6,25 @@ import PropTypes from 'prop-types';
import { Moment } from '@/components/proptypes';
import { clientConfig } from '@/services/auth';
import useForceUpdate from '@/lib/hooks/useForceUpdate';
import Tooltip from 'antd/lib/tooltip';

moment.updateLocale('en', {
Copy link
Member

Choose a reason for hiding this comment

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

As this is something that applies globally it probably should be somewhere else (app/config?).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 56b6571

relativeTime: {
future: '%s',
past: '%s',
s: 'just now',
Copy link
Member

Choose a reason for hiding this comment

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

Did we change any of the other strings or only this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nay.
I experimented with short-handing ("2 minutes ago" to "2m ago") but there's no straightforward way with moment to apply it for widgets only.

@ranbena ranbena requested a review from arikfr July 29, 2019 13:47
@arikfr arikfr merged commit 5ddad86 into master Jul 29, 2019
@arikfr arikfr deleted the justnow branch July 29, 2019 15:04
harveyrendell pushed a commit to pushpay/redash that referenced this pull request Nov 14, 2019
* Updated timeago strings

* Moved moment config to app/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants