Munzee Time Zone

Change the time zone for the (mouseover) times at the munzee website

  1. // ==UserScript==
  2. // @name Munzee Time Zone
  3. // @namespace https://gf.qytechs.cn/users/156194
  4. // @version 0.1
  5. // @description Change the time zone for the (mouseover) times at the munzee website
  6. // @author rabe85
  7. // @match https://www.munzee.com/m/
  8. // @match https://www.munzee.com/m/*
  9. // @match https://statzee.munzee.com/player/day/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function munzee_time_zone() {
  17.  
  18. const TimeString = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', timeZone: 'Europe/Berlin', hour12: false };
  19.  
  20. // Munzee - Player pages
  21. function change_all(type) {
  22. var classname_at0 = document.getElementsByClassName(type + '-at');
  23. for(var at = 0, classname_at; !!(classname_at=classname_at0[at]); at++) {
  24. var classname;
  25. if(type == 'expires') {
  26. classname = new Date(parseInt(classname_at.getAttribute('data-' + type + '-at')));
  27. } else {
  28. classname = new Date(classname_at.getAttribute('data-' + type + '-at'));
  29. }
  30. classname_at.setAttribute('title', classname.toLocaleDateString('de-DE', TimeString));
  31. }
  32. }
  33.  
  34. change_all('deployed');
  35. change_all('expires');
  36. change_all('captured');
  37. change_all('wrote');
  38.  
  39.  
  40. // Statzee - Daily Stats
  41. var stats_table0 = document.querySelectorAll('td');
  42. for(var hq = 0, stats_table; !!(stats_table=stats_table0[hq]); hq++) {
  43. if(stats_table.innerHTML.endsWith('HQ Time')) {
  44. var hq_date = window.location.pathname.split('/')[window.location.pathname.split('/').length - 1];
  45. var hq_timezone = document.getElementById('hqtime').parentNode.innerHTML.split(')')[0].substr(-1);
  46. var hq_time = new Date(hq_date + 'T' + stats_table.innerHTML.substr(0, 8) + '-0' + hq_timezone + ':00');
  47. stats_table.setAttribute('title', hq_time.toLocaleDateString('de-DE', TimeString));
  48. }
  49. }
  50.  
  51. }
  52.  
  53. // DOM vollständig aufgebaut?
  54. if (/complete|interactive|loaded/.test(document.readyState)) {
  55. munzee_time_zone();
  56. } else {
  57. document.addEventListener("DOMContentLoaded", munzee_time_zone, false);
  58. }
  59.  
  60. })();

QingJ © 2025

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