eight04 / angular-datetime

A directive to add the behavior of datetime input on unsupported browsers.
MIT License
93 stars 28 forks source link

mvc json date serialization #16

Closed akyazilim closed 7 years ago

akyazilim commented 8 years ago

return new JsonResult(){Data={new { Data = MYmodel}};

client result : "/Date(1239018869048)/"

[{ "ID": 1, "PublishedAt": "\/Date(1330848000000-0800)\/", "Text": "Best blog post ever", "Title": "Magical Title" }, { "ID": 2, "PublishedAt": "\/Date(1320825600000-0800)\/", "Text": "No, really", "Title": "You rock" }]

How can I parse this case ?

eight04 commented 8 years ago

Do you mean to parse the value into a date object? Since the value is a timestamp and Angular doesn't represent date in timestamp format, you can't parse it with this module.

But you can do it manually: http://stackoverflow.com/questions/726334/asp-net-mvc-jsonresult-date-format