7keyammo's picture
Update this file to be able to be save documents as pdf locally and save the progress
7285b64 verified
raw
history blame contribute delete
588 Bytes
// Shared functions for the physics peer grading app
function getCurrentDateTime() {
const now = new Date();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const year = now.getFullYear();
return `${month}/${day}/${year}`;
}
// Auto-fill date field on page load
document.addEventListener('DOMContentLoaded', function() {
const dateField = document.getElementById('date');
if (dateField && !dateField.value) {
dateField.value = getCurrentDateTime();
}
});
// Add any additional shared functionality here