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

Optionally specify a time from other than now() #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrtom
Copy link

@mrtom mrtom commented Sep 2, 2017

moment.js allows us to specify a time from other than now() by using from() rather than fromNow().

This diff exposes that in the timeago API using an optional timeFrom prop

return (
<Text {...this.props}>{moment(this.props.time).from(this.props.timeFrom, this.props.hideAgo)}</Text>
);
} else {
Copy link
Owner

Choose a reason for hiding this comment

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

Minor nit: the else here is redundant.

@TylerLH
Copy link
Owner

TylerLH commented Sep 9, 2017

Would you be able to update the README to document your changes in this PR as well? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants