Calendar-Hebrew

 view release on metacpan or  search on metacpan

lib/Calendar/Hebrew.pm  view on Meta::CPAN

package Calendar::Hebrew;

$Calendar::Hebrew::VERSION   = '0.15';
$Calendar::Hebrew::AUTHORITY = 'cpan:MANWAR';

=head1 NAME

Calendar::Hebrew - Interface to Hebrew Calendar.

=head1 VERSION

Version 0.15

=cut

use 5.006;
use Data::Dumper;

use Date::Hebrew::Simple;
use Moo;
use namespace::autoclean;
with 'Calendar::Plugin::Renderer';

use overload q{""} => 'as_string', fallback => 1;

has year  => (is => 'rw', predicate => 1);
has month => (is => 'rw', predicate => 1);
has date  => (is => 'ro', default   => sub { Date::Hebrew::Simple->new });

sub BUILD {
    my ($self) = @_;

    $self->date->validate_year($self->year) if $self->has_year;
    $self->date->validate_hebrew_month($self->month, $self->year) if $self->has_month;

    unless ($self->has_year && $self->has_month) {
        $self->year($self->date->year);
        $self->month($self->date->month);
    }
}

=head1 DESCRIPTION

The C<Calendar::Hebrew> was released on Sunday 23rd July 2017 to mark the completion
of L<1000th consecutive days of releasing to CPAN|http://blogs.perl.org/users/mohammad_s_anwar/2017/07/1000th-consecutive-days-releasing-to-cpan.html>.

The Hebrew or Jewish calendar is a lunisolar  calendar  used  today predominantly
for Jewish religious observances. It determines the dates for Jewish holidays and
the appropriate public reading of Torah portions, yahrzeits (dates to commemorate
the death of a relative), and daily Psalm readings, among many ceremonial uses.

The Hebrew lunar year is  about  eleven days shorter than the solar year and uses
the  19-year  Metonic  cycle  to bring it into line with the solar year, with the
addition  of an  intercalary month every two or three years, for a total of seven
 times  per  19 years. Even  with this intercalation, the average Hebrew calendar
year  is  longer by about 6 minutes and 40 seconds than the current mean tropical
year, so  that  every  216  years  the Hebrew calendar will fall a day behind the
current  mean  tropical year; and about every 231 years it will fall a day behind
the mean Gregorian calendar year.

    +--------------------------------------------------------------------------------------------------------+
    |                                            Tammuz [5777 BE]                                            |
    +--------------+--------------+--------------+--------------+--------------+--------------+--------------+
    |   Yom Rishon |    Yom Sheni | Yom Shelishi |    Yom Revil |  Yom Hamishi |   Yom Shishi |      Shabbat |
    +--------------+--------------+--------------+--------------+--------------+--------------+--------------+
    |            1 |            2 |            3 |            4 |            5 |            6 |            7 |
    +--------------+--------------+--------------+--------------+--------------+--------------+--------------+
    |            8 |            9 |           10 |           11 |           12 |           13 |           14 |
    +--------------+--------------+--------------+--------------+--------------+--------------+--------------+
    |           15 |           16 |           17 |           18 |           19 |           20 |           21 |
    +--------------+--------------+--------------+--------------+--------------+--------------+--------------+
    |           22 |           23 |           24 |           25 |           26 |           27 |           28 |
    +--------------+--------------+--------------+--------------+--------------+--------------+--------------+
    |           29 |                                                                                         |
    +--------------+--------------+--------------+--------------+--------------+--------------+--------------+

The package L<App::calendr> provides command line tool  C<calendr> to display the
supported calendars on the terminal. Support for  C<Hebrew Calendar>  is provided
by L<App::calendr> v0.16 or above.

=head1 SYNOPSIS



( run in 1.554 second using v1.01-cache-2.11-cpan-98e64b0badf )