Prevent overloading of window.onload

This commit is contained in:
Chris Wilson
2020-07-23 20:54:25 -04:00
parent 24c4972c44
commit 051555ef14
3 changed files with 7 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
window.onload = () => {
window.addEventListener('load', () => {
const timeElement = document.getElementById('creation-time');
const creationTime = timeElement.getAttribute('data-creation-time');
const creationDate = new Date(creationTime);
timeElement.innerText = creationDate.toLocaleString();
};
});