# DWR 3.0.2 jsonp and dates

**URL:** <https://discourse.dojo.io/t/dwr-3-0-2-jsonp-and-dates/421>\
**Category:** DWR users\
**Created:** [May 2, 2019, 10:34am UTC](https://discourse.dojo.io/t/dwr-3-0-2-jsonp-and-dates/421 "2019-05-02T10:34:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyl](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@andyl](https://discourse.dojo.io/u/andyl)\
**Post date:** [May 2, 2019, 10:34am UTC](https://discourse.dojo.io/t/dwr-3-0-2-jsonp-and-dates/421/1 "2019-05-02T10:34:59Z")

</div>

I have just updated DWR to 3.0.2 and set the jsonpEnabled parameter to true as I want to try that out (as part of a new section of functionality written using React).

Generally it works fine - a call to fetch a list of suppliers works and provides me with JSON to parse.

However when I fetch something which has a Date member then the json contains something like  
{  
“currentSeason”: “N”,  
“openStatus”: “O”,  
“seasonEndDate”: new Date(1543536000000),  
“seasonId”: 14,  
“seasonStartDate”: new Date(1512086400000),  
},

As far as I am aware (according to ECMA-404) - new Date(xxx) is invalid in JSON.

So is there a work-round for this? Or a fix planned? The alternative I guess is to write my a function to manipulate the data, turning new Dates() into some other valid representation, then post-processing.

---

<div class="post-metadata">

**Author:** ![mikewse](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mikewse](https://discourse.dojo.io/u/mikewse)\
**Post date:** [May 2, 2019, 7:53pm UTC](https://discourse.dojo.io/t/dwr-3-0-2-jsonp-and-dates/421/2 "2019-05-02T19:53:38Z")

</div>

Thanks for letting us know! Yes, the desired date format for JSON would be ISO 8601 strings. I’ve created an issue to fix this in the next release:

> <https://github.com/directwebremoting/dwr/issues/12>

In the meantime to workaround your problem you can override DWR’s DateConverter with a version that outputs the desired format. You then register the new converter in the `<init>` section of dwr.xml, read more here:  
[http://directwebremoting.org/dwr/documentation/server/configuration/dwrxml/index.html](http://directwebremoting.org/dwr/documentation/server/configuration/dwrxml/index.html)
