Skip to content

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.

2 participants