Date-Baha-i
view release on metacpan or search on metacpan
lib/Date/Baha/i.pm view on Meta::CPAN
my($bahai_year, $bahai_month, $bahai_day) = (175, 11, 6);
my $date = from_bahai(
year => $bahai_year,
month => $bahai_month,
day => $bahai_day,
);
($year, $month, $day) = from_bahai(
year => $bahai_year,
month => $bahai_month,
day => $bahai_day,
);
$day = next_holy_day();
$day = next_holy_day($year, $month, $day);
my @cycles = cycles();
my @years = years();
my @months = months();
my @days = days();
@days = days_of_the_week();
my %days = holy_days();
=head1 DESCRIPTION
This package renders the Baha'i date from two standard date formats -
epoch time and a (year, month, day) triple. It also converts a Baha'i
date to standard ymd format.
=head2 CYCLES
Each cycle of nineteen years is called a Vahid. Nineteen cycles constitute a
period called Kull-i-Shay.
The names of the years in each cycle are:
1. Alif - The Letter "A"
2. Ba - The letter "B"
3. Ab - Father
4. Dal - The letter "D"
5. Bab - Gate
6. Vav - The letter "V"
7. Abad - Eternity
8. Jad - Generosity
9. Baha - Splendour
10. Hubb - Love
11. Bahhaj - Delightful
12. Javab - Answer
13. Ahad - Single
14. Vahhab - Bountiful
15. Vidad - Affection
16. Badi - Beginning
17. Bahi - Luminous
18. Abha - Most Luminous
19. Vahid - Unity
=head2 MONTH NAMES
The names of the months in the Baha'i (Badi) calendar were given by the Bab, who
drew them from the nineteen names of God invoked in a prayer said during the
month of fasting in Shi'ih Islam. They are:
1. Baha - Splendour (21 March - 8 April)
2. Jalal - Glory (9 April - 27 April)
3. Jamal - Beauty (28 April - 16 May)
4. 'Azamat - Grandeur (17 May - 4 June)
5. Nur - Light (5 June - 23 June)
6. Rahmat - Mercy (24 June - 12 July)
7. Kalimat - Words (13 July - 31 July)
8. Kamal - Perfection (1 August - 19 August)
9. Asma' - Names (20 August - 7 September)
10. 'Izzat - Might (8 September - 26 September)
11. Mashiyyat - Will (27 September - 15 October)
12. 'Ilm - Knowledge (16 October - 3 November)
13. Qudrat - Power (4 November - 22 November)
14. Qawl - Speech (23 November - 11 December)
15. Masa'il - Questions (12 December - 30 December)
16. Sharaf - Honour (31 December - 18 January)
17. Sultan - Sovereignty (19 January - 6 February)
18. Mulk - Dominion (7 February - 25 February)
* Ayyam-i-Ha - Days of Ha (26 February - 1 March))
19. 'Ala - Loftiness (2 March - 20 March)
=head3 AYYAM-I-HA
Intercalary Days: Four (or five) days in a leap year, before the last month.
=head2 DAY NAMES
The days of the Baha'i week are:
1. Jalal - Glory (Saturday)
2. Jamal - Beauty (Sunday)
3. Kaml - Perfection (Monday)
4. Fidal - Grace (Tuesday)
5. 'Idal - Justice (Wednesday)
6. Istijlal - Majesty (Thursday)
7. Istiqlal - Independence (Friday)
The Baha'i day of rest is Isiqlal (Friday) and the Baha'i day begins and ends at
sunset.
=head2 HOLY DAYS
There are 11 Holy Days:
* Naw Ruz - The Spring Equinox
Generally March 21.
If the equinox falls after sunset on 21 March, Naw Ruz is observed on 22 March,
since the Baha'i day begins at sunset.
* Ridvan - Declaration of Baha'u'llah in 1863
1st day - 21 April
9th day - 29 April
12th day - 2 May
lib/Date/Baha/i.pm view on Meta::CPAN
=head2 next_holy_day()
$d = next_holy_day();
$d = next_holy_day($year, $month, $day);
Return the name of the first holy day after the provided date.
=head2 cycles()
@c = cycles();
Return the 19 cycle names as an array.
=head2 years()
@y = years();
Return the 19 year names as an array.
=head2 months()
@m = months();
Return the 19 month names as an array, along with the intercalary days as the
last element.
=head2 days()
@d = days();
Return the 19 day names as an array.
=head2 days_of_the_week()
@d = days_of_the_week();
Return the seven day-of-the-week names as an array.
=head2 holy_days()
%d = holy_days();
Return a hash with keys of the Holy Day names and values of the date or range.
These values are array references of either two or three elements:
B<month>, B<day> and the (optional) number of B<days observed>.
Dates are given in common, standard (non-Baha'i) format.
=head1 SEE ALSO
L<Date::Calc>
L<Exporter>
L<Lingua::EN::Numbers>
L<Lingua::EN::Numbers::Years>
L<http://calendar.bahaiq.com/>
=head1 TO DO
Base the date computation on the time of day (Baha'i day begins at sunset).
Make this a L<DateTime> module.
Support cycles and Kull-i-Shay.
Overload localtime and gmtime, just to be cool?
=head1 AUTHOR
Gene Boggs <gene@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by Gene Boggs.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 2.994 seconds using v1.01-cache-2.11-cpan-2398b32b56e )