Date-Bahai-Simple

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      - Improved method from_gregorian().

0.16  Thu Nov 03 09:40:00 2016
      - Added key 'provides' to the Makefile.PL script.

0.15  Wed Aug 03 12:25:00 2016
      - Updated the dependency on Date::Utils v0.21.

0.14  Mon Jul 18 10:50:00 2016
      - Updated the dependency on Date::Utils v0.20.
      - Dropped method get_calendar() as it's no longer relevant here.

0.13  Thu May 12 10:35:00 2016
      - Added the dependency on Date::Utils v0.18.
      - Updated method get_calendar() and method as_string() to use get_month_name().
      - Updated method validate_month() to validate month name.
      - Renamed method bahai_months() to months().
      - Renamed method bahai_days() to days().
      - Updated method get_calendar() to respect the above changes.
      - Added test to validate month name.
      - Added section "SEE ALSO".

0.12  Thu Apr 28 10:20:00 2016
      - Updated the dependency on Date::Utils v0.16.
      - Added $AUTHORITY.
      - Updated copyright year information.

0.11  Mon Aug 24 11:45:00 2015
      - Added the dependency on Date::Utils v0.11.
      - Updated method validate_day() and validate_month() to make use of Date::Exception package.

0.10  Tue Jul 14 14:05:00 2015
      - Added the dependency on Date::Utils v0.10.
      - Added method get_calendar().

0.09  Fri Jul 03 11:00:00 2015
      - Added the dependency on Date::Utils v0.09.
      - Tidied up pod document in general.

0.08  Tue Jun 23 09:50:00 2015
      - Updated method to_gregorian() to return (yyyy,mm,dd) to be consistent with other Date::* packages of mine.
      - Updated unit test to reflect the above changes.
      - Updated section "SYNOPSIS" to reflect the above changes.
      - Also add example for method from_gregorian() and from_julian().

lib/Date/Bahai/Simple.pm  view on Meta::CPAN

#
#
# PRIVATE METHODS

sub _vernal_equinox_month_day {
    my ($year) = @_;

    # Source: Wikipedia
    # In 2014, the Universal House of Justice selected  Tehran, the birthplace of
    # Baha'u'lláh, as the location to which the date of  the vernal equinox is to
    # be fixed, thereby "unlocking" the Badi calendar from the Gregorian calendar.
    # For determining  the dates,  astronomical  tables from reliable sources are
    # used.
    # In  the  same  message  the  Universal  House  of  Justice decided that the
    # birthdays  of  the Bab and Baha'u'lláh will be celebrated on "the first and
    # the  second  day  following  the  occurrence  of  the eighth new moon after
    # Naw-Ruz"  (also with the use of astronomical tables) and fixed the dates of
    # the Bahaí Holy Days in the Baha'í calendar, standardizing dates for Baha'ís
    # worldwide. These changes came into effect as of sunset on 20 March 2015.The
    # changes  take effect from the next Bahai New Year, from sunset on March 20,
    # 2015.

    my $month = 3;
    my $day   = 20;

    if ($year >= 2015) {
        my $equinox_date = calculate_equinox('mar', 'utc', $year);
        if ($equinox_date =~ /\d{4}\-(\d{2})\-(\d{2})\s/) {



( run in 0.433 second using v1.01-cache-2.11-cpan-c333fce770f )