move date-fmt to the bitty script
This commit is contained in:
@@ -246,4 +246,12 @@ export default class {
|
||||
el.scrollIntoView();
|
||||
el.focus();
|
||||
}
|
||||
|
||||
convertTimestamps(ev, el) {
|
||||
const timestamp = el.getInt('utc');
|
||||
if (!isNaN(timestamp)) {
|
||||
const date = new Date(timestamp * 1000);
|
||||
el.textContent = date.toLocaleString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const timestampSpans = document.getElementsByClassName("timestamp");
|
||||
for (let timestampSpan of timestampSpans) {
|
||||
const timestamp = parseInt(timestampSpan.dataset.utc);
|
||||
if (!isNaN(timestamp)) {
|
||||
const date = new Date(timestamp * 1000);
|
||||
timestampSpan.textContent = date.toLocaleString();
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user