format a date react code example
Example 1: react date format
npm install moment --save
Example 2: how to trim dates in react
var timeAgo = moment(this.props.message.createdAt).fromNow()
<span className="date timeago" title={ timeAgo }>
{ timeAgo }</span>