Advertisement
Guest User

Untitled

a guest
Dec 9th, 2018
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           MMA Tycoon Show Weekday on fight offers.
  3. // @namespace      http://www.tycoontools.com/greasemonkey-scripts
  4. // @description    This script adds weekday to fight offers date.
  5. // @include        http://www.mmatycoon.com/fightoffers.php*
  6. // @include        http://mmatycoon.com/fightoffers.php*
  7. // @version        1.0
  8. // @copyright      2018
  9. // @require        http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
  10. // ==/UserScript==
  11.  
  12. function Main() {
  13.   var weekday = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];
  14.   jQuery("table table table table > tbody > tr:not(:first-child) > td:nth-child(6)").each(function() {
  15.     var currentDate = jQuery(this).clone().children().remove().end().text();
  16.     currentDate = $.trim(currentDate);
  17.     var date = new Date(currentDate);
  18.     var dayOfWeek = weekday[date.getDay()]
  19.     jQuery(this).prepend(dayOfWeek+'<br>');
  20.   });
  21.  
  22. }
  23.  
  24. Main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement