i'm trying to sort the values i get from my realtime database converted to Map. This is what I get:
{Table 2:
{
order 1:
{
WATER: {price: 1.50, quantity: 2},
date: 2022-12-14 17:34:51.428972}
},
Table 1:
{
order 2:
{
date: 2022-12-14 17:35:04.761532,
COCA COLA: {price: 2, quantity: 1}
},
order 1:
{
DAISY: {price: 7, quantity: 1},
date: 2022-12-14 17:22:12.678864,
4 CHEESES: {price: 7, quantity: 1},
WATER: {price: 1.50, quantity: 2}
}
}
}
What I want is to compare all orders by date so as to get them chronologically, resulting in something like this:
{Table 1:
{
order 1:
{
DAISY: {price: 7, quantity: 1},
dates: 2022-12-14 17:22:12.678864,
4 CHEESES: {price: 7, quantity: 1},
WATER: {price: 1.50, quantity: 2}
},
Table 2:
{
order 1:
{
WATER: {price: 1.50, quantity: 2},
date: 2022-12-14 17:34:51.428972}
},
Table 1:
{
order 2:
{
dates: 2022-12-14 17:35:04.761532,
COCA COLA: {price: 2, quantity: 1}
},
},
}