I have a C# model which I return to my view, I then convert this to an array of JSON objects like so:
@{
string data = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(Model);
}
var modelData = @Html.Raw(data);
My Model looks like this:
public int Id { get; set; }
public DateTime Date { get; set; }
public decimal Value { get; set; }
When I output the Date it gets output as: Date: /Date(1338279123847)/
Is there anyway I can convert the date to a Javascript date before outputting it on my view, perhaps from within my modelData array? In the form of DD/MM/YYYY
DateTime.Now