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

8 lines
263 B
JavaScript

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();
});