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

Shorter time ago in recent commits #1326

Merged
merged 10 commits into from Mar 1, 2018

Conversation

Projects
None yet
2 participants
@simurai
Member

simurai commented Mar 1, 2018

Description of the Change

This shortens the "time ago". E.g. 2 hours ago to just 2h.

Before After
screen shot 2018-03-01 at 2 30 59 pm screen shot 2018-03-01 at 2 29 47 pm
  • For "a few seconds" it says "Now".
  • For months an uppercase M is used to differentiate from minutes.

Alternate Designs

We could also use twitter or short date formatter plugin. These only have a short form under 1 week.

Benefits

Less space for the time ago, more space for the message + status icon or maybe refs.

Possible Drawbacks

Might not be too obvious what the short form means. But maybe still fine, Twitter and other apps use it too.

Applicable Issues

This PR is on top of #1322.

simurai and others added some commits Mar 1, 2018

@smashwilson

This comment has been minimized.

Member

smashwilson commented Mar 1, 2018

Nice

screen shot 2018-03-01 at 9 41 46 am

The Timeago component is already being used elsewhere in the package (specifically in the GitHub PR timeline) so I've added a displayStyle prop that we can use to toggle which format is used. I've also changed it to localize the short diffs in a custom locale derived from en rather than configuring Moment globally (shakes fist at global state) and added tests for both styles.

Thanks for getting this started and doing the legwork for customizing Moment there 😄

@smashwilson smashwilson merged commit f8f2753 into ku-aw-read-only-recent-commits Mar 1, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@smashwilson smashwilson deleted the sm-short-timeago branch Mar 1, 2018

@simurai

This comment has been minimized.

Member

simurai commented Mar 1, 2018

The Timeago component is already being used elsewhere in the package (specifically in the GitHub PR timeline) so I've added a displayStyle prop that we can use to toggle which format is used.

👍 Awesome. Yeah, in the pane, with more space, the longer form is nicer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment