change time format to string format react 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
const DATE_OPTIONS = { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric' };