Lequel est le bon ?
Celui ci :
ou celui-ci dans meteo.html - phases lunaire:papoo a écrit :Pour ceux qui utilisent les phases lunaires, mettez le code à jour, j'avais inversé l'appel des images des phases croissantes et décroissantes
désolé
Code : Tout sélectionner
if (theMoon >= 29) { moonText = "Nouvelle Lune"; moonIcon = "wi-moon-new"; moonPNG = "moon0.png"; } else if (theMoon < 29 && theMoon > 23) { moonText = "Dernier croissant"; moonIcon = "wi-moon-waning-crescent-3"; moonPNG = "moon7.png"; } else if (theMoon <= 23 && theMoon > 22) { moonText = "Dernier quartier"; moonIcon = "wi-moon-third-quarter"; moonPNG = "moon6.png"; } else if (theMoon <= 22 && theMoon > 15) { moonText = "Gibbeuse décroissante"; moonIcon = "wi-moon-waning-gibbous-3"; moonPNG = "moon5.png"; } else if (theMoon <= 15 && theMoon > 13) { moonText = "Pleine lune"; moonIcon = "wi-moon-full"; moonPNG = "moon4.png"; } else if (theMoon <= 13 && theMoon > 8) { moonText = "Gibbeuse croissante"; moonIcon = "wi-moon-waxing-gibbous-2"; moonPNG = "moon3.png"; } else if (theMoon <= 8 && theMoon > 6) { moonText = "Premier Quartier"; moonIcon = "wi-moon-first-quarter"; moonPNG = "moon2.png"; } else if (theMoon <= 6 && theMoon > 1) { moonText = "Premier croissant"; moonIcon = "wi-moon-waxing-crescent-2"; moonPNG = "moon1.png"; } else { moonText = "Nouvelle Lune"; moonIcon = "wi-moon-new"; moonPNG = "moon0.png"; }
Code : Tout sélectionner
console.log( "Phase Lunaire : " + theMoon )
if (theMoon >= 29) {
moonText = "Nouvelle Lune";
moonPNG = "moon0.png";
} else if (theMoon < 29 && theMoon > 23) {
moonText = "Dernier croissant";
moonPNG = "moon7.png";
} else if (theMoon < 23 && theMoon > 22) {
moonText = "Dernier quartier";
moonPNG = "moon6.png";
} else if (theMoon < 22 && theMoon > 15) {
moonText = "Gibbeuse décroissante";
moonPNG = "moon5.png";
} else if (theMoon < 15 && theMoon > 13) {
moonText = "Pleine lune";
moonPNG = "moon4.png";
} else if (theMoon < 13 && theMoon > 8) {
moonText = "Gibbeuse croissante";
moonPNG = "moon3.png";
} else if (theMoon < 8 && theMoon > 6) {
moonText = "Premier Quartier";
moonPNG = "moon2.png";
} else if (theMoon < 6 && theMoon > 1) {
moonText = "Premier croissant";
moonPNG = "moon1.png";
} else {
moonText = "Nouvelle Lune";
moonPNG = "moon0.png";21-22-23/09 affiche "Premier Croissant"
24-25/09 affiche "Dernier Croissant"
26-27/09 affiche "Nouvelle lune"
28-29-30/09 affiche "Premier Croissant"
01-02/10 affiche "Dernier Croissant"
03/10 affiche "Nouvelle Lune"
Une idée ?


