Below is my json data:
var homes={
"ERROR": "SUCCESS",
"DATA": [
{
"BookingID": "9513",
"DutyStart": "2016-02-11 12:00:00"
},
{
"BookingID": "91157307",
"DutyStart": "2016-02-11 13:00:00"
},
{
"BookingID": "95117317",
"DutyStart": "2016-02-11 13:30:00"
},
{
"BookingID": "957266",
"DutyStart": "2016-02-12 19:15:00"
},
{
"BookingID": "74",
"DutyStart": "2016-02-11 12:21:00"
}
]
};
I want to sort the array according to DutyStart
(in date format) in Descending and Ascending order using Javascript only and append the data to body or alert the sorted array.
I tried the solution fromThis question but iam not able to get it.
Thanks in advance.