Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

132
Vistas
I am actually having a problem on pushing the data into the firebase rtdb

Actually the thing is that I am not able to push the realtime location of the user to the firebase rtdb and I had to make the value constant but this is really making my client disappointed, Here's the code:

firebase.initializeApp(firebaseConfig);
var database = firebase.database();
document.querySelector('#send').addEventListener('click', () => {
    var username = document.getElementById("input").value;
    var inout = document.getElementById("inout").value;
    var today = new Date();
    const monthNames = ["January", "February", "March", "April", "May", "June",
        "July", "August", "September", "October", "November", "December"
    ];
    const dateObj = new Date();
    const month = monthNames[dateObj.getMonth()];
    const day = String(dateObj.getDate()).padStart(2, '0');
    const year = dateObj.getFullYear();
    const output = day + month + year;
    var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
    var lat = 22.992344005762106;
    var lon = 88.39171958538499;
    var data = {
        name: username,
        time: time + "," + inout,
        lat: lat,
        lon: lon
    };
    var firebaseRef = firebase.database().ref('users/' + output + time);
    firebaseRef.set(data);

})
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda