Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function subirPost()
- {
- let Post = {};
- Post.post = document.getElementById("MuroContent").value;
- var d = new Date();
- var hora = d.getHours();
- var minutos = d.getMinutes();
- Post.metric = {};
- let fecha = d.getFullYear()+"-"+d.getMonth()+"-"+d.getDay();
- Post.metric.time = fecha+"--"+hora+"."+minutos;
- let user = firebase.auth().currentUser;
- var ref = firebase.database().ref("Muro/"+ user.uid + "/Posts");
- var newRef = ref.push();
- console.log(Post.date);
- newRef.set(Post);
- }
- function ObtenerPostUser()
- {
- let user = firebase.auth().currentUser;
- console.log(user.uid)
- var ref = firebase.database().ref("Muro/"+user.uid);
- ref.orderByChild('metric/time').on("child_added", function(snapshot){
- console.log(snapshot.val());
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement