date string fomate rect 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
{(new Date()).toLocaleDateString('en-US', DATE_OPTIONS)}