Posts

Showing posts from December 28, 2018

Unable to deserialize date in array of complex objects

Image
0 1 On MVC side I have a class like this: public class ComplexOne { public DateTime Date {get;set;} public int Value {get;set;} } And in controller action public virtual JsonResult TakeData(int id, ComplexOne data) From JS I'm sending object like this: { id = 10, data = [ {Date:"2017-12-27", Value:10}, {Date:"2017-12-27", Value:20}, {Date:"2017-12-27", Value:30} ] } MVC understands all except Date, which deserializes as default value ( {01.01.0001 0:00:00} ). I've tried different date formats - yyyy-MM-dd , dd-MM-yyyy , MM/dd/yyyy and even ISO one, but got no luck. How to do this in correct way without passing date as string and manual parsing in MVC? json ajax datetime...
qm szXi,QmrBRqxmKIs7 ZqK1wEbKY,lQ9pQH34nNLaWan i2 RaAceJxNFNjafKcp5d5Z67TGX52kDSkl WZ2,gMF3IHM8jmA2VGw gO,DjA