react string format to date code example
Example 1: 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>
Example 2: how to trim dates in react
npm i momemt --save