NAME

Date::Holidays::FR - Determine French holidays

SYNOPSIS

Checking one day

use Date::Holidays::FR;
my ($year, $month, $day) = (localtime)[5, 4, 3];
$year  += 1900;
$month +=    1;
print "Woohoo" if is_fr_holiday($year, $month, $day);

Computing the mobile days

use Date::Holidays::FR;
my ($month, $day) = get_easter($year);
my ($month, $day) = get_ascension($year);
my ($month, $day) = get_pentecost($year);

Checking a whole year

use Date::Holidays::FR;
my $days_off = holidays($year);
for my $mmdd (sort keys  %$days_off) {
  print "$mmdd $days_off->{$mmdd}\n";
}

DESCRIPTION

is_fr_holiday method return true value when the day is holiday.

There are 11 holidays in France:

  • 1er janvier : Nouvel an / New Year's Day

  • Lundi de Pâques / Easter Monday

  • 1er mai : Fête du travail / Labour Day

  • 8 mai : Armistice 1939-1945

  • Ascension

  • Lundi de Pentecôte / Pentecost Monday

  • 14 juillet : Fête nationale / Bastille Day

  • 15 août : Assomption / Assumption

  • 1er novembre : Toussaint / All Saints' Day

  • 11 novembre : Armistice 1914-1918

  • 25 décembre : Noël / Christmas

Easter is computed with Date::Easter module.

Ascension is 39 days after Easter.

Pentecost monday is 50 days after Easter.

SUBROUTINES

is_fr_holiday($year, $month, $day), is_holiday($year, $month, $day)

Returns the name of the holiday in french that falls on the given day, or a false value if there is none.

is_holiday is a wrapper for is_fr_holiday to be compatible with the naming conventions of Date::Holidays.

fr_holidays($year), holidays($year)

Returns a hashref containing all the holidays for the requested year. Keys are the dates in MMDD format, values are French labels for the holidays.

holidays is a wrapper for fr_holidays to be compatible with the naming conventions of Date::Holidays.

get_easter($year)

Returns the month and day of easter monday for the given year.

get_ascension($year)

Returns the month and day of ascension day for the given year.

get_pentecost($year)

Returns the month and day of pentecost monday for the given year.

BUGS AND ISSUES

No known bugs.

On rare instances (last one was in 1913, next one will be on 2160), the Ascension falls on 1st May, same day as the Fête du Travail. In this case, the fr_holidays (or holidays) subroutine refers to this date as Ascension, not as Fête du Travail.

Likewise, on some years the Ascension falls on 8th May, same day as Armistice 1939-1945. As above, the Ascension takes precedence on the Armistice. This conflict is much more frequent than the conflict with 1st May. For example, it occurred in 1975, 1986 and 1997, it will occur again in 2070, 2081 and 2092.

This behaviour is subject to change, in future releases the Fête du Travail or Armistice 1939-1945 might preempt Ascension instead of the other way around.

SUPPORT

Please report any requests, suggestions or bugs via Github. Go to https://github.com/jforget/Date-Holidays-FR, and create an issue or submit a pull request.

If you have no feedback after a week or so, you can reach me by email at JFORGET at cpan dot org. Please mention the distribution name in the subject, so my spam filter and me will easily dispatch the email to the proper folder.

On the other hand, I may be on vacation. Do not be upset if the answer arrives after one or two months. Be upset only if you do not receive an answer to several emails over at least one year.

AUTHORS

Module creator: Fabien Potencier

Current maintainer: Jean Forget (JFORGET at cpan dot org)

Thanks

Many thanks to JONASBN, for maintaining Date::Holidays and for suggesting some cleanup of the code.

LICENSE

Copyright (c) 2004, 2019, 2021 Fabien Potencier and Jean Forget. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself: GNU Public License version 1 or later and Perl Artistic License.

The full text of the license can be found in the LICENSE file included with this module or at https://dev.perl.org/licenses/artistic.html and https://www.gnu.org/licenses/gpl-1.0.html.

Here is the summary of GPL:

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see https://www.gnu.org/licenses/ or contact the Free Software Foundation, Inc., https://fsf.org.

SEE ALSO

perl(1), Date::Holidays, Date::Holidays::UK, Date::Holidays::DE.