hatecomputers.club/static/js/components/formatDate.js

8 lines
263 B
JavaScript
Raw Normal View History

2024-03-29 18:35:04 -04:00
const timeElements = document.querySelectorAll(".time");
timeElements.forEach((timeElement) => {
const dateStr = timeElement.textContent.split(" ").slice(0, 3).join(" ");
const date = new Date(dateStr);
timeElement.textContent = date.toLocaleString();
});