Révision e9259900
b/index.php | ||
---|---|---|
17 | 17 |
"noel" => array(25, 12, "Noël") |
18 | 18 |
); |
19 | 19 |
|
20 |
function getPaquesDay($year) { |
|
21 |
$b = $year-1900; |
|
22 |
$c = $year % 19; |
|
23 |
$d = (7*$c+1)/19; |
|
24 |
$e = (11*$c+4-$d) % 29; |
|
25 |
$f = $b/4; |
|
26 |
$g = ($b+$f+31-$e) % 7; |
|
27 |
$h = 25-$e-$g; |
|
28 |
if ($h > 0) { |
|
29 |
$jour = $h; |
|
30 |
$mois = 4; |
|
31 |
} else { |
|
32 |
$jour = $h+31; |
|
33 |
$mois = 3; |
|
34 |
} |
|
35 |
return array($jour, $mois); |
|
36 |
} |
|
37 |
|
|
38 | 20 |
$year = date("Y"); |
39 | 21 |
if (isset($_GET['year'])) $year = $_GET['year']; |
40 | 22 |
if (isset($_GET['annee'])) $year = $_GET['annee']; |
41 | 23 |
|
42 |
list($jourPaques, $moisPaques) = getPaquesDay($year); |
|
43 |
$datePaques = strtotime("$year-$moisPaques-$jourPaques"); |
|
44 |
$lstFeries['paques'][0] = $jourPaques; |
|
45 |
$lstFeries['paques'][1] = $moisPaques; |
|
24 |
$datePaques = easter_date($year); |
|
25 |
$lstFeries['paques'][0] = date('j', $datePaques); |
|
26 |
$lstFeries['paques'][1] = date('n', $datePaques); |
|
46 | 27 |
$ts = strtotime("-7 days", $datePaques); |
47 | 28 |
$lstFeries['rameaux'][0] = date("j", $ts); |
48 | 29 |
$lstFeries['rameaux'][1] = date("n", $ts); |
Formats disponibles : Unified diff