Good morning, I'm studying IONIC with Firebase and created a simple list where I want it to be sorted by update date. In the image we can see that the date is the same as it came from Firebase.
Itriedtodothis:
pedidos:anyconstructor(){//InitializeFirebaseconstconfig={apiKey:"c",
authDomain: "c",
databaseURL: "c",
projectId: "c",
storageBucket: "c.c.c",
messagingSenderId: "c"
};
firebase.initializeApp(config);
this.pedidos = new Array();
let ref = firebase.database().ref('statuspedido').orderByChild('dataAtualizacao');//statuspedido
ref.on('value', (dataSnapshot) =>{
let items = dataSnapshot.val();
for(let dados in items){
this.pedidos.push(
new PedidoModel(
items[dados].idPedido,
items[dados].dataEmissao,
items[dados].dataAtualizacao,
items[dados].vendedor,
items[dados].frete,
items[dados].transportadora,
items[dados].status)
)
}
})
}
and in firebase: