您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
12h to 24h format converter
当前为
// ==UserScript== // @name the100 24h format // @namespace https://www.the100.io/ // @version 0.1 // @description 12h to 24h format converter // @author Fryde // @match https://www.the100.io/* // @grant none // ==/UserScript== (function() { var times = document.getElementsByClassName('game-time'); for ( i=0; i<times.length; i++) { var old = times[i].innerHTML; var regex = /([01]?\d)(:\d{2}) (AM|PM)/ig; var match = regex.exec(old); //12:00 -> 00:00 match[1] = match[1]%12; //add 12h for pm if( match[3] == "PM" || match[3] == "pm") match[1] += 12; //add leading 0 if needed if( match[1] < 10) match[1] = "0"+match[1]; times[i].innerHTML = old.replace(regex, match[1] + match[2] + ' Uhr'); //add old time to title attribute times[i].title=old; } })();