Date-Lectionary

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    Date::Lectionary - Readings for the Christian Lectionary

VERSION
    Version 1.20200203

SYNOPSIS
        use Time::Piece;
        use Date::Lectionary;

        my $epiphany = Date::Lectionary->new('date'=>Time::Piece->strptime("2017-01-06", "%Y-%m-%d"));
        say $epiphany->day->name; #String representation of the name of the day in the liturgical calendar; e.g. 'The Epiphany'
        say $epiphany->year->name; #String representation of the name of the liturgical year; e.g. 'A'
        say ${$epiphany->readings}[0] #String representation of the first reading for the day.

DESCRIPTION
    Date::Lectionary takes a Time::Piece date and returns the liturgical day
    and associated readings for the day.

  ATTRIBUTES
   date
    The Time::Piece object date given at object construction.

README.md  view on Meta::CPAN

# VERSION

Version 1.20200203

# SYNOPSIS

    use Time::Piece;
    use Date::Lectionary;

    my $epiphany = Date::Lectionary->new('date'=>Time::Piece->strptime("2017-01-06", "%Y-%m-%d"));
    say $epiphany->day->name; #String representation of the name of the day in the liturgical calendar; e.g. 'The Epiphany'
    say $epiphany->year->name; #String representation of the name of the liturgical year; e.g. 'A'
    say ${$epiphany->readings}[0] #String representation of the first reading for the day.

# DESCRIPTION

Date::Lectionary takes a Time::Piece date and returns the liturgical day and associated readings for the day.

## ATTRIBUTES

### date

README.pod  view on Meta::CPAN



=cut

=head1 SYNOPSIS

    use Time::Piece;
    use Date::Lectionary;

    my $epiphany = Date::Lectionary->new('date'=>Time::Piece->strptime("2017-01-06", "%Y-%m-%d"));
    say $epiphany->day->name; #String representation of the name of the day in the liturgical calendar; e.g. 'The Epiphany'
    say $epiphany->year->name; #String representation of the name of the liturgical year; e.g. 'A'
    say ${$epiphany->readings}[0] #String representation of the first reading for the day.

=head1 DESCRIPTION

Date::Lectionary takes a Time::Piece date and returns the liturgical day and associated readings for the day.

=head2 ATTRIBUTES

=head3 date

lib/Date/Lectionary.pm  view on Meta::CPAN

=cut

use version; our $VERSION = version->declare("v1.20200203");

=head1 SYNOPSIS

    use Time::Piece;
    use Date::Lectionary;

    my $epiphany = Date::Lectionary->new('date'=>Time::Piece->strptime("2017-01-06", "%Y-%m-%d"));
    say $epiphany->day->name; #String representation of the name of the day in the liturgical calendar; e.g. 'The Epiphany'
    say $epiphany->year->name; #String representation of the name of the liturgical year; e.g. 'A'
    say ${$epiphany->readings}[0] #String representation of the first reading for the day.

=head1 DESCRIPTION

Date::Lectionary takes a Time::Piece date and returns the liturgical day and associated readings for the day.

=head2 ATTRIBUTES

=head3 date

lib/Date/Lectionary/Day.pm  view on Meta::CPAN

        $easter = Time::Piece->strptime( $easterYear . "-" . $easterMonth . "-" . $easterDay, "%Y-%m-%d" );
        return $easter;
    }
    catch {
        confess "Could not calculate Easter for the year [" . $easterYear . "]";
    };
}

=head2 _determineFeasts

Private method that takes the Time::Piece date given at construction and determines if the date is one of many feasts in the liturgical calendar.  Feasts are taken from the Anglican Church in North America's revision of the revised common lectionary.

=cut

sub _determineFeasts {
    my $date       = shift;
    my $lectionary = shift;

    my $yesterday = $date - ONE_DAY;

    my $yesterdayName;

lib/Date/Lectionary/Day.pm  view on Meta::CPAN

            type       => 'moveableFeast',
            season     => 'NaN'
        );
    }

    return ( commonName => undef, type => undef, season => 'NaN' );
}

=head2 _buildMoveableDays

Private method that takes the Time::Piece date given at construction and determines if the date is one of many moveable feasts in the liturgical calendar.  Feasts are taken from the Anglican Church in North America's revision of the revised common le...

=cut

sub _buildMoveableDays {
    my $date       = shift;
    my $lectionary = shift;

    #Moveable holidays in January
    if ( $date->mon == 1 ) {
        if ( $date->mday == 18 && $lectionary eq 'acna' ) {

lib/Date/Lectionary/Day.pm  view on Meta::CPAN

            return "Holy Innocents";
        }
    }
    else {
        confess "Date [" . $date->ymd . "] is not a known or valid date.";
    }
}

=head2 _buildFixedDays

Private method that takes the Time::Piece date given at construction and determines if the date is one of many fixed (non-moveable) feasts in the liturgical calendar.  Fixed feasts are taken from the Anglican Church in North America's revision of the...

=cut

sub _buildFixedDays {
    my $date       = shift;
    my $lectionary = shift;

    #Fixed holidays in January
    if ( $date->mon == 1 ) {
        if ( $date->mday == 1 ) {



( run in 0.452 second using v1.01-cache-2.11-cpan-5dc5da66d9d )