We have created SPFx react web part. We want to display data from SharePoint list into a grid. One of the fields is a date field. So need to format the date field. Below is the success function:
success: function(resultData) {
reactHandler.setState({
items: resultData.d.results
});
And below is the div:
{this.state.items.map(function(item,key){
return (
<div className={styles.rowStyle} key={key}>
<div className={styles.CellStyle}>{item.Title}</div>
<div className={styles.CellStyle}>{item.StartDate}</div>
</div>);
})}
where item.StartDate is the date field. How to format the below date field to show data in mm/dd/yyyy format instead of SharePoint date format?