moment doesn't seem to parse date objects
I'm having a weird experience using moment in jsReport to parse dates. The moment library works fine for this example in the node REPL or my node projects, but in jsReport it doesn't seem to want to work.
Not sure if anyone's encountered this before.
I set up a simple example in the jsreport playground:
Don't pass Date instance to the moment factory function. Use getTime instead
const moment = require('moment'); const jsDate = new Date(2016, 0, 1); return moment(jsDate.geTime()).format('YYYY-MM-DD') }
I submitted the issue and we will try to communicate it with the author and see how we can proceed.
Thanks for the response. It's pretty strange. In the mean time I'll use the workaround.