DateTime Value is not deserialized correctly

Feb 26, 2013 at 12:58 AM
Edited Feb 27, 2013 at 4:21 PM
I am not sure if this is fixed.

when deserialize the date time value : "2013-02-25T08:00:00Z"
new Date("2013-02-25T08:00:00Z") returns NaN.
Coordinator
Feb 26, 2013 at 9:37 AM
Hi

Which version are you using?

Please provide more details here

Thanks,
Jaimie
Feb 27, 2013 at 4:26 PM
Edited Feb 27, 2013 at 4:26 PM
/**
  • MSCRM 2011 Web Service Toolkit for JavaScript
  • @version : 1.0
  • Date: February, 2012
    */
When retreve case with Followup (datetime field with date value only), the deserization throws exception in IE 9 with CRM UR8
Feb 27, 2013 at 10:46 PM
Edited Mar 1, 2013 at 12:17 AM
It's IE Document Mode:

IE8 standards: new Date("2013-02-25T08:00:00Z") returns NaN.
IE9 standards: new Date("2013-02-25T08:00:00Z") returns correct date.

Any way to fix this?

From MSDN:

The ISO format is a simplification of the ISO 8601 extended format. The format is as follows:
YYYY-MM-DDTHH:mm:ss.sssZ
______Important
ISO Date Format is not supported in Internet Explorer 8 standards mode and Quirks mode.______
Coordinator
Mar 1, 2013 at 12:49 PM
Hi There.

This is a new conversion in 1.4.1 to convert string to Date. It might fix your issue.

I also would recommend you give 1.4.0 a try considering you are using version 1.0

Jaimie
  var stringToDate = function (s) {
        var b = s.split(/\D/);
        return new Date(Date.UTC(b[0], --b[1], b[2], b[3], b[4], b[5]));
    };
Mar 1, 2013 at 8:49 PM
Thanks a lot for the fix.

Will upgrade when upgrading to UR12, It's on premise.