Hi,
This is more a reference post .. I had problems figuring out how to get a javascript date on the client side browser to be serialized in the correct format for .Net to deserialize it using System.Runtime.Serialization.Json. I think the solution I came up with is fairly elegant and easy to use.
We are aiming for the javascript to serialize the Date and end up with a format of:
"/Date(946645200000+1100)/"
To do this, i'm using the json2.js script available from http://www.json.org/js.html, to do most of the JSON serializing grunt, and i'm overriding how the dates are 'stringified' by using this function:
Date.prototype.toJSON = function(key) {
function enforceMinTwoChars(n) {
// Format integers to have at least two digits.
&n ...
Go to the complete details ...