Changes the format of the timestamp in the message boards
当前为
// ==UserScript==
// @name GameFAQs - date reformatter
// @version 0.1
// @namespace gamefaqs
// @description Changes the format of the timestamp in the message boards
// @include https://gamefaqs.gamespot.com/boards/*
// @reqiore https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js
// @grant none
// ==/UserScript==
const existingFormat = "MM/DD/YYYY hh:mm:ss A";
const newFormat = "DD/MM/YYYY HH:mm:ss";
function formatTimes() {
const dateNodes = document.getElementsByClassName('post_time');
for (node of dateNodes) {
const formattedDate = moment(node.textContent, existingFormat).format(newFormat);
node.textContent = formattedDate;
}
}
formatTimes();