I need to sort Date in object (as key).
I think that I should to convert it in an array of objects and after I have to convert it into an object, but it seems too difficult. This is the data of the multilevel object:
{
"2017-02-18": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 13.4,
"provider": 13.04
}
},
"2017-02-14": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 5.4,
"provider": 5.04
}
},
"2017-02-13": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 1.4,
"provider": 1.04
}
},
"2017-02-17": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 21.4,
"provider": 21.04
}
},
"2017-02-15": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 44.4,
"provider": 44.04
}
},
"2017-02-16": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 56.4,
"provider": 56.04
}
}
}
After the sort I need an object with this result:
{
"2017-02-13": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 1.4,
"provider": 1.04
}
},
"2017-02-14": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 5.4,
"provider": 5.04
}
},
"2017-02-15": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 44.4,
"provider": 44.04
}
},
"2017-02-16": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 56.4,
"provider": 56.04
}
},
"2017-02-17": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 21.4,
"provider": 21.04
}
},
"2017-02-18": {
"prod_work": {
"product": 0,
"product_type": 0
},
"prod_work1": {
"tax": 13.4,
"provider": 13.04
}
}
}
Thanks to all for help!