date fomate rect code example
Example 1: react date format
npm install moment --save
Example 2: how to trim dates in react
<span className="date timeago" title={ this.props.message.createdAt }>
{new Intl.DateTimeFormat('en-GB', {
month: 'long',
day: '2-digit',
year: 'numeric',
}).format(new Date(this.props.message.createdAt))}
</span>