Date.Easter
HTML
Dates
<div id="annee"></div>
<div id="paques"></div>
<div id="langue"></div>
<div id="easterDay"></div>
JavaScript
function Easter(Y) {
var C = Math.floor(Y/100);
var N = Y - 19*Math.floor(Y/19);
var K = Math.floor((C - 17)/25);
var I = C - Math.floor(C/4) - Math.floor((C - K)/3) + 19*N + 15;
I = I - 30*Math.floor((I/30));
I = I - Math.floor(I/28)*(1 - Math.floor(I/28)*Math.floor(29/(I + 1))*Math.floor((21 - N)/11));
var J = Y + Math.floor(Y/4) + I + 2 - C + Math.floor(C/4);
J = J - 7*Math.floor(J/7);
var L = I - J;
var M = 3 + Math.floor((L + 40)/44);
var D = L + 28 - 31*Math.floor(M/4);
return M + '.' + D;
}
Date.easterDay = function( annee ) {
var C = Math.floor(annee/100);
var N = annee - 19*Math.floor(annee/19);
var K = Math.floor((C - 17)/25);
var I = C - Math.floor(C/4) - Math.floor((C - K)/3) + 19*N + 15;
I = I - 30*Math.floor((I/30));
I = I - Math.floor(I/28)*(1 - Math.floor(I/28)*Math.floor(29/(I + 1))*Math.floor((21 - N)/11));
var J = annee + Math.floor(annee/4) + I + 2 - C + Math.floor(C/4);
J = J - 7*Math.floor(J/7);
var L = I - J;
var M = 3 + Math.floor((L + 40)/44);
var D = L + 28 - 31*Math.floor(M/4);
return new Date( annee, M - 1 , D );
}
document.getElementById('annee').textContent = 2014;
document.getElementById('paques').textContent = Easter(2011);
document.getElementById('langue').textContent = window.navigator.language;
document.getElementById('easterDay').textContent = Date.easterDay(2015).toLocaleDateString();
function estFerie( uneDate ) {
var estFerie = false;
if( ( uneDate.getMonth() == 0 && uneDate.getDate() == 1 )
|| ( uneDate.getMonth() == 4 && uneDate.getDate() == 1 )
|| ( uneDate.getMonth() == 4 && uneDate.getDate() == 8 )
|| ( uneDate.getMonth() == 6 && uneDate.getDate() == 14 )
|| ( uneDate.getMonth() == 7 && uneDate.getDate() == 15 )
|| ( uneDate.getMonth() == 10 && uneDate.getDate() == 1 )
|| ( uneDate.getMonth() == 10 && uneDate.getDate() == 11 )
|| ( uneDate.getMonth() == 11 && uneDate.getDate() == 25 )
// || (...