how to trim time from date in react js code example
Example 1: how to trim dates in react
{(new Date()).toLocaleDateString('en-US', DATE_OPTIONS)}
Example 2: how to trim dates in react
var timeAgo = moment(this.props.message.createdAt).fromNow()
<span className="date timeago" title={ timeAgo }>
{ timeAgo }</span>