score:8

Accepted answer

value is a date object. Try this:

<div>{moment(value).format('DD-MM-YYYY')}</div>

score:0

Date is Object itself and Objects are not valid as a React child. You need to convert value to string as,

<div>{value.toDateString()}</div>

Or, you can use Moment Js

<div>{moment(value).format('DD-MM-YYYY')}</div>

score:0

I had to use new Date(...) in combination with * 1000 to get the workable date format, an example:

new Date(props.date * 1000).toLocaleDateString()

score:2

I think you might be using a date wrongly

<div>{value.toDateString()}</div>

might solve the problem

score:13

React doesn't allow objects like Dates or Arrays as children, you need to convert value to string, like this:

<div>{new Date(value).toString()}</div>

Hope this helps you!


Related Query

More Query from same tag