Skip to content

Commit

Permalink
Corrected issue with Epiphany on a Sunday
Browse files Browse the repository at this point in the history
Epiphany being on a Sunday would off-set Sundays in Epiphany by a week.
  • Loading branch information
marmanold committed Jan 21, 2019
1 parent 641d0e1 commit b709cb8
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 23 deletions.
8 changes: 4 additions & 4 deletions MYMETA.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@
"provides" : {
"Date::Lectionary" : {
"file" : "lib/Date/Lectionary.pm",
"version" : "1.20180625"
"version" : "1.20190120"
},
"Date::Lectionary::Day" : {
"file" : "lib/Date/Lectionary/Day.pm",
"version" : "1.20180625"
"version" : "1.20190120"
},
"Date::Lectionary::Year" : {
"file" : "lib/Date/Lectionary/Year.pm",
"version" : "1.20180625"
"version" : "1.20190120"
}
},
"release_status" : "stable",
Expand All @@ -91,7 +91,7 @@
"web" : "https://github.com/marmanold/Date-Lectionary"
}
},
"version" : "v1.20180625",
"version" : "v1.20190120",
"x_serialization_backend" : "JSON::PP version 2.97001",
"x_twitter" : "https://www.twitter.com/marmanold/"
}
8 changes: 4 additions & 4 deletions MYMETA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ no_index:
provides:
Date::Lectionary:
file: lib/Date/Lectionary.pm
version: '1.20180625'
version: '1.20190120'
Date::Lectionary::Day:
file: lib/Date/Lectionary/Day.pm
version: '1.20180625'
version: '1.20190120'
Date::Lectionary::Year:
file: lib/Date/Lectionary/Year.pm
version: '1.20180625'
version: '1.20190120'
requires:
Carp: '1.38'
Date::Advent: '1.20180422'
Expand All @@ -63,6 +63,6 @@ requires:
perl: '5.022'
resources:
repository: git://github.com/marmanold/Date-Lectionary.git
version: v1.20180625
version: v1.20190120
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
x_twitter: https://www.twitter.com/marmanold/
8 changes: 4 additions & 4 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ WriteMakefile(
'Moose::Util::TypeConstraints' => '2.2010',
'MooseX::Aliases' => '0.11',
'Date::Lectionary::Time' => '1.20180422.1',
'Date::Advent' => '1.20180422',
'Date::Advent' => '1.20180423',
'Date::Easter' => '1.22',
'namespace::autoclean' => '0.28',
'File::Share' => '0.25',
Expand All @@ -60,15 +60,15 @@ WriteMakefile(
provides => {
'Date::Lectionary' => {
file => 'lib/Date/Lectionary.pm',
version => '1.20180625'
version => '1.20190120'
},
'Date::Lectionary::Day' => {
file => 'lib/Date/Lectionary/Day.pm',
version => '1.20180625'
version => '1.20190120'
},
'Date::Lectionary::Year' => {
file => 'lib/Date/Lectionary/Year.pm',
version => '1.20180625'
version => '1.20190120'
},
},
keywords => [qw/ lectionary rcl acna readings christian liturgical /],
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ NAME
Date::Lectionary - Readings for the Christian Lectionary

VERSION
Version 1.20180625
Version 1.20190120

SYNOPSIS
use Time::Piece;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Date::Lectionary - Readings for the Christian Lectionary

# VERSION

Version 1.20180625
Version 1.20190120

# SYNOPSIS

Expand Down
2 changes: 1 addition & 1 deletion README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Date::Lectionary - Readings for the Christian Lectionary

=head1 VERSION

Version 1.20180625
Version 1.20190120


=cut
Expand Down
4 changes: 2 additions & 2 deletions lib/Date/Lectionary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Date::Lectionary - Readings for the Christian Lectionary
=head1 VERSION
Version 1.20180625
Version 1.20190120
=cut

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

=head1 SYNOPSIS
Expand Down
9 changes: 6 additions & 3 deletions lib/Date/Lectionary/Day.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ Date::Lectionary::Day - Determines the Day in the Christian Liturgical Year
=head1 VERSION
Version 1.20180625
Version 1.20190120
=cut

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

=head1 SYNOPSIS
Expand Down Expand Up @@ -401,7 +401,7 @@ sub _determineFeasts {
}

my $fixedDayName = _buildFixedDays( $date, $lectionary );
if ( $fixedDayName ) {
if ($fixedDayName) {
return (
commonName => $fixedDayName->{commonName},
type => 'fixedFeast',
Expand Down Expand Up @@ -879,6 +879,9 @@ sub _determineChristmasEpiphany {
if ( $date == $dateMarker && $christmas2 == 1 ) {
return $epiphanySundays[$sunCount];
}
elsif ( $date == $dateMarker && $epiphany->wday == 1 ) {
return $epiphanySundays[$sunCount];
}
elsif ( $date == $dateMarker && $christmas2 == 0 ) {
return $epiphanySundays[ $sunCount + 1 ];
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Date/Lectionary/Year.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ Date::Lectionary::Year - Cycle Year for the Lectionary
=head1 VERSION
Version 1.20180625
Version 1.20190120
=cut

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

=head1 SYNOPSIS
Expand Down
26 changes: 25 additions & 1 deletion t/02-day-commonName.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use v5.22;
use strict;
use warnings;
use Test::More tests => 175;
use Test::More tests => 178;
use Test::Exception;

use Time::Piece;
Expand Down Expand Up @@ -1148,3 +1148,27 @@ is(
"The First Sunday of Christmas",
'Validating that 2017-12-31 returns the correct day.'
);

$sunday = Date::Lectionary->new(
'date' => Time::Piece->strptime( "2019-01-20", "%Y-%m-%d" ) );
is(
$sunday->day->commonName,
"The Second Sunday of Epiphany",
'Validating that 2019-01-20 returns the correct day.'
);

$sunday = Date::Lectionary->new(
'date' => Time::Piece->strptime( "2019-01-13", "%Y-%m-%d" ) );
is(
$sunday->day->commonName,
"The First Sunday of Epiphany",
'Validating that 2019-01-13 returns the correct day.'
);

$sunday = Date::Lectionary->new(
'date' => Time::Piece->strptime( "2019-01-06", "%Y-%m-%d" ) );
is(
$sunday->day->commonName,
"The Epiphany",
'Validating that 2019-01-06 returns the correct day.'
);

0 comments on commit b709cb8

Please sign in to comment.