NAME

Date::Lectionary::Time - Find your way in time relative to Sundays.

VERSION

Version 1.20170311

SYNOPSIS

Working in the liturgical time of the lectionary means tracking time relative to Sundays. This is a quick utility to find the next, previous, or the closest Sunday to a given date. Further, it can determine if the date given is a Sunday or not.

	use Time::Piece;
	use Date::Lectionary::Time qw(nextSunday prevSunday closestSunday isSunday);

	my $christmasDay = Time::Piece->strptime("2015-12-25", "%Y-%m-%d");

    if (isSunday($christmasDay)) {
        say "Christmas is on a Sunday!";
    }
    else {
        say "Christmas isn't on a Sunday.";
    }

	my $sundayAfterChristmas = nextSunday($christmasDay);
	my $sundayBeforeChristmas = prevSunday($christmasDay);
	my $sundayClosestToChristmas = closestSunday($christmasDay);

EXPORTS

nextSunday

prevSunday

closestSunday

isSunday

use Date::Lectionary::Time qw(nextSunday prevSunday closestSunday isSunday);

SUBROUTINES/METHODS

nextSunday

For a given Time::Piece date returns a Time::Piece object of the date of the Sunday immediately following the given date.

prevSunday

For a given Time::Piece date returns a Time::Piece object of the date of the Sunday immediately before the given date.

closestSunday

For a given Time::Piece date returns a Time::Piece object of the date of the Sunday closest to the given date.

isSunday

For a given Time::Piece date returns 1 if the date is a Sunday or 0 if the date isn't a Sunday.

AUTHOR

Michael Wayne Arnold, <marmanold at cpan.org>

BUGS

Please report any bugs or feature requests to bug-date-lectionary-time at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Date-Lectionary-Time. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Date::Lectionary::Time

The development of this module is hosted on GitHub -- https://github.com/marmanold/Date-Lectionary-Time -- and tested via TravisCI.

Coverage Status

You can also look for information at:

ACKNOWLEDGEMENTS

Many thanks to my beautiful wife, Jennifer, and my amazing daughter, Rosemary. But, above all, SOLI DEO GLORIA!

LICENSE AND COPYRIGHT

Copyright 2016 Michael Wayne Arnold.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.