I was trying to render a date stored in Mongo (the typical new Date()), however React throws a hissy fit. I also tried to use https://www.npmjs.com/package/react-raw-html to render it as I am also rendering raw html in some instances.
That is because the date that’s stored in Mongo is not a renderable string.
You’ll need the toString() method to render it.
If you’re working with dates a lot, be sure to try out moment?.
It’s an awesome date library for JS!
You need to convert it into a String or Number first. There’s a host of built in methods that give you different formatted outputs: http://www.w3schools.com/jsref/jsref_obj_date.asp
moment.js is great too
Ah I c, I was under the assumption it got stored as a string given its mixture of characters.