DataTable.Editor using DateTime in Format "ShipmentDate": "\/Date(1711062000000)\/"

DataTable.Editor using DateTime in Format "ShipmentDate": "\/Date(1711062000000)\/"

marc42marc42 Posts: 4Questions: 2Answers: 0
edited April 18 in Editor

I am trying to get the the Editor working with Date, Time and DateTime in this frmat:
"ShipmentDate": "\/Date(1711062000000)\/",
"ShipmentTime": "\/Date(1711125552000)\/",

Display is ok i can just write my own render.

But i have not been able to get the Editor working.
Any good triks?

Thanks
Marc

Answers

  • marc42marc42 Posts: 4Questions: 2Answers: 0

    Looks like wireformat wouldbe the property to use, but I have not found the format definition for JSON dates

  • allanallan Posts: 61,798Questions: 1Answers: 10,115 Site admin

    Looks like a .NET Date object. If you can, I would encourage you to use ISO8601 on the wire rather than a format like that.

    The .NET epoch (year 0001) is not the same as the Unix epoch (1970) and looking at the Moment date formatting there isn't a specific character for the .NET epoch, so it isn't possible to use wireFormat to read such a date.

    That said, it actually looks like Moment will support this date.

    So what I think you would have to do (if you can't change the date format) is to use xhr to spin over the data returned from the server and use Moment to convert the .NET string date into something that is useable in Javascript.

    Allan

Sign In or Register to comment.