Merge pull request #17210 from Csardelacal/dev/goodfriday

Good friday is a holiday
This commit is contained in:
Laurent Destailleur 2021-04-10 12:33:26 +02:00 committed by GitHub
commit b6e4bdbc6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -775,6 +775,21 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '',
//print 'annee='.$annee.' $jour='.$jour.' $mois='.$mois.' $jour_lundi_paques='.$jour_lundi_paques.' $mois_lundi_paques='.$mois_lundi_paques."\n";
}
//Good Friday
if (in_array('goodfriday', $specialdayrule)) {
// Pulls the date of Easter
$easter = getGMTEasterDatetime($annee);
// Calculates the date of Good Friday based on Easter
$date_good_friday = $easter - (2 * 3600 * 24);
$dom_good_friday = gmdate("d", $date_good_friday);
$month_good_friday = gmdate("m", $date_good_friday);
if ($dom_good_friday == $jour && $month_good_friday == $mois) {
$ferie = true;
}
}
if (in_array('ascension', $specialdayrule)) {
// Calcul du jour de l'ascension (39 days after easter day)
$date_paques = getGMTEasterDatetime($annee);