tr
`;
// Display the ticket
const ticketContainer = document.getElementById('ticketContainer');
ticketContainer.innerHTML = ticketHTML;
ticketContainer.style.display = 'block';
// Scroll to the ticket
ticketContainer.scrollIntoView({ behavior: 'smooth' });
}
function formatDate(date) {
const day = String(date.getDate()).padStart(2, '0');
const month = String(date.getMonth() + 1).padStart(2, '0');
const year = date.getFullYear();
return `${day}/${month}/${year}`;
}
function formatTime(timeString) {
if (!timeString) return '';
const [hours, minutes] = timeString.split(':');
let period = 'AM';
let hour = parseInt(hours);
if (hour >= 12) {
period = 'PM';
if (hour > 12) {
hour -= 12;
}
}
return `${hour}:${minutes} ${period}`;
}
