Rick Measham schreef:
> Beta 2 includes support for Orthodox Easter, however I doubt it 
> handles it the best way possible. Please take a look and offer 
> suggestions (its the last sub before the POD). It should also be 
> noted that both Easters should return Gregorian Dates as they do now.

The $potential_easter shouldn't be in eastern_easter. When called with
year => 60000, the result is an infinite loop:

Called with year 60000, result is 60001-06-24
Called with year 59999, result is 60000-07-02
Called with year 59998, result is 59999-06-13
Called with year 59997, result is 59998-06-28
Called with year 59996, result is 59997-07-06
ad infinitum

Unless I understand the eastern_easter function incorrectly, the loop
should be in _easter:

sub _easter {
    my $self = shift;
    my $year = shift;
    if ($self->{easter} eq 'eastern') {
        my $date;
        my $y = $year;
        do {
            $date = eastern_easter($y);
            $y += ($year <=> $date->year);
        } until ($date->year == $year);
        return $date;
    } else {
        western_easter($year);
    }
}

What do you do with years without an Easter? Try the year 35000:

Called with year 35000, result is 35001-01-04
Called with year 34999, result is 34999-12-15
Called with year 35000, result is 35001-01-04
Called with year 34999, result is 34999-12-15
Called with year 35000, result is 35001-01-04
etc.

And what about the years with 2 Easters? Do your 'following' and
'previous' work for them? It looks like they work by changing the year
by one...

Best solution would perhaps to convert to Julian at the start of those
methods, and to convert them back to Gregorian at the end.
(DateTime::Calendar::Julian could be useful here ;-)

And some small points:

- Documentation bug: 'fullmoon' should be 'easter' in the constructor
  options.

- In the POD, your lines are longer than 80chars, which is a bit
  annoying.


Eugene

Reply via email to