I'm passing a list of c# objects to my view via my viewmodel. The object has a 'EndDate' (DateTime type) as a property. Then I encode it to a Json object array to be used in Javascript. In Javascript I try to read the 'EndDate' property and then set it to a input field of type DateTime but the value is some long string that I don't recognize. How do I convert this back or use it?
Here is my code.
In my view I set the list of objects to a js variable
<script type="text/javascript">
var availableLicenses = @Html.Raw(Json.Encode(Model.AvailableLicenses));
</script>
When I look at the EndDate property in Chrome dev tools it looks like this.
enter code here
I want to set this EndDate value "/Date(1501459200000)/" to a date value for a DateTime input element, but I'm not sure how to convert it?
<input id="EndDate"type="datetime" value="put converted date here" required>