I know that are a lot of posts about consuming a WCF REST through JQuery/JSON, but I can\'t get it to work. I\'m currently stuck at a date parameter. Below is my C# method:<
There should be a generic method to format the date properly before passing to the wcf.
The method could look like this:
var dateToWcf = function(input)
{
var d = new Date(input);
if (isNaN(d)) return null;
var formattedDate = { date : "/Date(" + d.getTime() + ")/" };
return formattedDate;
}
However now if you post it would append the offset value based on the actual timezone from where you are posting.So in order to avert this you could then adjust the offset accordingly.
var formattedDate = { date: "/Date(" + d.getTime() + d.getGMTOffset() + ")/" };