I am utilizing DateTime to create Date objects and sending them as JSON to the UI. How can I work with this in JavaScript (specifically AngularJS) and convert it back and forth?
For instance, if I need the user to update the time, I should be able to retrieve the Date/Time from a form submission and send it back to the server in JSON format.
Below is the current DateTime JSON output that the client receives:
"date": {
"year": 2013,
"era": 1,
"dayOfMonth": 3,
"dayOfWeek": 7,
"dayOfYear": 34,
"millisOfDay": 3660000,
"centuryOfEra": 20,
"yearOfCentury": 13,
"monthOfYear": 2,
"weekOfWeekyear": 5,
"millisOfSecond": 0,
"hourOfDay": 1,
"yearOfEra": 2013,
"weekyear": 2013,
"secondOfMinute": 0,
"secondOfDay": 3660,
"minuteOfHour": 1,
"minuteOfDay": 61,
"zone": {
"fixed": true,
"id": "UTC"
},
"millis": 1359853260000,
"chronology": {
"zone": {
"fixed": true,
"id": "UTC"
}
},
"beforeNow": true,
"afterNow": false,
"equalNow": false
}