Skip to content

Commit

Permalink
gh
Browse files Browse the repository at this point in the history
  • Loading branch information
zebrastribe authored Aug 16, 2024
1 parent e64d29e commit 0917983
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async function fetchCheckIns() {
const q = query(collection(db, "clicks"), orderBy("timestamp", "desc"));
const querySnapshot = await getDocs(q);
const checkInsList = document.getElementById('checkInsList');
checkInsList.innerHTML = ''; // Clear the list
checkInsList.innerHTML = ''; // Clear the table body

const docs = querySnapshot.docs;
const totalPages = Math.ceil(docs.length / entriesPerPage);
Expand All @@ -105,9 +105,15 @@ async function fetchCheckIns() {
const formattedDate = `${date.getDate()} of ${date.toLocaleString('en-US', { month: 'long' })} ${date.getFullYear()}`;
const time = date.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false });

const listItem = document.createElement('li');
listItem.textContent = `${name} checked in at (${latitude}, ${longitude}) on ${day} ${formattedDate} at ${time}`;
checkInsList.appendChild(listItem);
const row = document.createElement('tr');
row.innerHTML = `
<td class="py-2 px-4 border-b border-gray-200">${name}</td>
<td class="py-2 px-4 border-b border-gray-200">${latitude}</td>
<td class="py-2 px-4 border-b border-gray-200">${longitude}</td>
<td class="py-2 px-4 border-b border-gray-200">${formattedDate}</td>
<td class="py-2 px-4 border-b border-gray-200">${time}</td>
`;
checkInsList.appendChild(row);
});

document.getElementById('prevPage').disabled = currentPage === 1;
Expand Down

0 comments on commit 0917983

Please sign in to comment.