MOH_timeconversion

Ajoute des infobulles pour convertir le temps IRL<->IG

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        MOH_timeconversion
// @autor       Alcor
// @include     http://www.marchofhistory.com/EcranPrincipal.php*
// @version     1.4
// @grant       none
// @description Ajoute des infobulles pour convertir le temps IRL<->IG
// @namespace https://greasyfork.org/users/15102
// ==/UserScript==

$(document).on("mouseover mousemove", "#texteZoneDate", function(){
    $(this).attr("title", '05h20 Printemps - 11h20 Ete - 17h20 Automne - 23h20 hiver');
});

$(document).on("mouseover mousemove", "[data-temps]", function(){
    var listeMois = ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "aôut", "septembre", "octobre", "novembre", "décembre"];
    var timeSec = parseInt($(this).attr('data-temps'));
    var timeDay = Math.round(timeSec/237);
    var jour = parseInt($('#HeaderDateJour').text());
    var mois = $('#HeaderDateMois').text();
    var annee = parseInt($('#HeaderDateAnnee').text());
    for (i = 0; i<12; i++){
      if(mois==listeMois[i]){
            mois=i;
            break;
        }
    }
    var jourFin = jour+timeDay;
    var moisFin = mois;
    var anneeFin = annee;
    while (jourFin>30){
        jourFin = jourFin - 30;
        moisFin = moisFin + 1;
        
    }
    while (moisFin>11){
        moisFin = moisFin - 12;
        anneeFin = anneeFin + 1;
    }
    
    $(this).attr('title', jourFin + " " + listeMois[moisFin] + " " + anneeFin);
});