FMP Time Show

Show FMP Time

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         FMP Time Show
// @name:zh-CN   FMP Time Show
// @version      0.5
// @description:zh-CN  显示FMP时间
// @description  Show FMP Time
// @match        https://footballmanagerproject.com/*
// @match        https://www.footballmanagerproject.com/*
// @license      MIT
// @grant        none
// @namespace https://greasyfork.org/users/1304483
// ==/UserScript==

(function() {
    'use strict';
    let seasonTime = document.getElementsByClassName("navbar-season");
    const time = Math.floor(FMP.Date.Today());
    const dayDiv = document.createElement('span');
    dayDiv.className = 'week';
    dayDiv.innerHTML = '第 '+ (time%84%7+1) +' 日';
    seasonTime[0].appendChild(dayDiv);
    const seasonEndDiv = document.createElement('span');
    seasonEndDiv.className = 'week';
    seasonEndDiv.innerHTML = '距赛季结束 '+ (84-time%84) +' 日';
    seasonTime[0].appendChild(seasonEndDiv);
    const totalDayDiv = document.createElement('span');
    totalDayDiv.className = 'week';
    totalDayDiv.innerHTML = '总计 第 '+ time +' 日';
    seasonTime[0].appendChild(totalDayDiv);
    const totalWeekDiv = document.createElement('span');
    totalWeekDiv.className = 'week';
    totalWeekDiv.innerHTML = '第 '+ Math.floor(time/7) +' 周';
    seasonTime[0].appendChild(totalWeekDiv);
})();