Github 时间显示24H格式

将 Github 的时间转换为24H格式

  1. // ==UserScript==
  2. // @name Github 时间显示24H格式
  3. // @namespace https://h3110w0r1d.com/
  4. // @version 2025-02-16
  5. // @description 将 Github 的时间转换为24H格式
  6. // @author h3110w0r1d
  7. // @license MIT
  8. // @match https://github.com/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15. setInterval(function(){
  16. document.querySelectorAll('relative-time').forEach((item) => {
  17. item.setAttribute("format", "datetime");
  18. item.setAttribute("weekday", "");
  19. item.setAttribute("lang", "zh");
  20. item.setAttribute("month", "numeric");
  21. item.setAttribute("second", "2-digit");
  22. item.setAttribute("minute", "2-digit");
  23. item.setAttribute("hour", "2-digit");
  24. });
  25. }, 1000);
  26. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址