DMY Nekoweb Dates

This script converts MDY dates on Nekoweb feed posts to DMY and adds a zero to single-digit months and days.

  1. // ==UserScript==
  2. // @name DMY Nekoweb Dates
  3. // @namespace http://tampermonkey.net/
  4. // @version 2025-03-07
  5. // @description This script converts MDY dates on Nekoweb feed posts to DMY and adds a zero to single-digit months and days.
  6. // @author Sen Choi
  7. // @match https://nekoweb.org/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=nekoweb.org
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function reformatDate(dateString) {
  17. let match = dateString.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);
  18. if (match) {
  19. let month = match[1].padStart(2, '0');
  20. let day = match[2].padStart(2, '0');
  21. let year = match[3];
  22. return `${day}/${month}/${year}`;
  23. }
  24. return dateString;
  25. }
  26.  
  27. function updateDates() {
  28. document.querySelectorAll('.post-date').forEach(span => {
  29. span.textContent = reformatDate(span.textContent);
  30. });
  31. }
  32.  
  33. updateDates();
  34. })();

QingJ © 2025

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