您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Changes the date of the infraction to the local timezone.
当前为
// ==UserScript== // @name Appeal date to local time // @namespace Violentmonkey Scripts // @match https://appeals.cubecraft.net/find_appeals/* // @grant none // @version 1.2 // @author Caliditas // @description Changes the date of the infraction to the local timezone. // ==/UserScript== var infractions = document.getElementsByClassName("col-sm-8"); var amountOfInfractions = infractions[0].children.length; for (var i = 0; i < amountOfInfractions; i++) { replaceDate(infractions[0].children[i].firstElementChild); } function replaceDate(element) { var contentString = element.innerHTML; dateStringOld = contentString.slice(contentString.indexOf(" at ") + 3, contentString.indexOf(" for")) + " UTC"; var dateOldMs = Date.parse(dateStringOld); var dateOld = new Date(dateOldMs); var contentStringChanged = contentString.slice(0, contentString.indexOf(" at ") + 4) + dateOld.toString().slice(4, 10) + "," + dateOld.toString().slice(10, 25) + initials(new Date().toString().match(/\(([A-Za-z\s].*)\)/)[1]) contentStringChanged += contentString.slice(contentString.indexOf(" for")); element.innerHTML = contentStringChanged; } function initials(words) { if (words.includes(" ")) { var wordsArray = words.split(" "); var initials = ""; for (var i = 0; i < wordsArray.length; i++) { initials += wordsArray[i][0]; } return initials; } else { return words; } }