Use local times for post dates

This commit is contained in:
2023-02-25 15:04:36 +11:00
parent 49bf9dc52d
commit f3cf53938e
5 changed files with 18 additions and 3 deletions

9
public/assets/index.js Normal file
View File

@@ -0,0 +1,9 @@
(function() {
document.addEventListener("DOMContentLoaded", function () {
const times = document.querySelectorAll('time');
times.forEach((time) => {
const oldDtime = Date.parse(time.dateTime);
time.innerHTML = new Date(oldDtime).toLocaleDateString(navigator.language, { weekday:"long", year:"numeric", month:"short", day:"numeric"});
});
});
})();