Date-Advent
view release on metacpan or search on metacpan
# NAME
Date::Advent - Calculate the Sundays of Advent
# VERSION
Version 1.20180423
# SYNOPSIS
Date::Advent takes a Time::Piece date and calculates all four Sundays of Advent for the current Christian liturgical year.
As Advent is the beginning of the Christian liturgical calendar, this usually results in the date for Advent in the current year being dates in the past. E.g. The Sundays of Advent returned for 12. March 2016 would be 29. November 2015, 6. December ...
use Time::Piece;
use Date::Advent;
my $testAdvent = Date::Advent->new(date => Time::Piece->strptime("2016-01-01", "%Y-%m-%d"));
say $testAdvent->firstSunday; #Gives date for first Sunday of Advent
say $testAdvent->secondSunday; #Gives date for second Sunday of Advent
say $testAdvent->thirdSunday; #Gives date for third Sunday of Advent
say $testAdvent->fourthSunday; #Gives date for fourth Sunday of Advent
say $testAdvent->christmas; #Gives date of Christmas
# Object Attributes
## date
Time::Piece date object. Only attribute required at object construction.
## christmas
Time::Piece attribute for Christmas Day as calculated from the `date` given at object construction.
## firstSunday
Time::Piece attribute for the first Sunday of Advent as calculated from the `date` given at object construction.
## secondSunday
Time::Piece attribute for the second Sunday of Advent as calculated from the `date` given at object construction.
## thirdSunday
Time::Piece attribute for the third Sunday of Advent as calculated from the `date` given at object construction.
## fourthSunday
Time::Piece attribute for the fourth Sunday of Advent as calculated from the `date` given at object construction.
# Object Constructor
## BUILD
Constructor for the Date::Advent object. Takes the Time::Piece argument of `date` as the date to calculate the current Christian liturgical year's Sundays of Advent from. The resulting object is immutable and cannot be changed once created.
my $testAdvent = Date::Advent->new(date => Time::Piece->strptime("2016-01-01", "%Y-%m-%d"));
# AUTHOR
Michael Wayne Arnold, `<michael at rnold.info>`
# BUGS
<div>
<a href='https://travis-ci.org/marmanold/Date-Advent'><img src='https://travis-ci.org/marmanold/Date-Advent.svg?branch=master' /></a>
</div>
<div>
<a href='https://coveralls.io/github/marmanold/Date-Advent?branch=master'><img src='https://coveralls.io/repos/github/marmanold/Date-Advent/badge.svg?branch=master' alt='Coverage Status' /></a>
</div>
Please report any bugs or feature requests to `bug-date-advent at rt.cpan.org`, or through
( run in 2.288 seconds using v1.01-cache-2.11-cpan-364913b4093 )