SHARE
TWEET

Pihach date fix

a guest Oct 4th, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name Pihach date fix
  3. // @description Устанавливает формат даты как на том дваче
  4. // @namespace   https://dva-ch.net/d/
  5. // @include https://dva-ch.net/*
  6. // @include https://2ch.rip/*
  7. // ==/UserScript==
  8. num = document.getElementsByClassName("posttime");
  9. for (var i = 0; i < num.length; i++) {
  10.     dateString = document.getElementsByClassName("posttime")[i].innerText;
  11.     dateStringNew = dateString.split(" ");
  12.     dateStringNew[4] = dateStringNew[4].replace(/\s+/g, '');
  13.     [dateStringNew[1], dateStringNew[2]] = [dateStringNew[2], dateStringNew[1]];
  14.     [dateStringNew[3], dateStringNew[4]] = [dateStringNew[4], dateStringNew[3]];
  15.     dateStringNew = dateStringNew.join(" ");
  16.     dateString = document.getElementsByClassName("posttime")[i].innerText = dateStringNew;
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top