DateTime-Indic

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

# $Id: /local/DateTime-Indic/trunk/Build.PL 342 2008-05-24T18:02:40.063670Z jaldhar  $
#
use strict;
use warnings;
use Module::Build;

my $builder = Module::Build->new(
    dist_name           => 'DateTime-Indic',
    license             => 'perl',
    dist_author         => 'Jaldhar H. Vyas <jaldhar@braincells.com>',
    dist_abstract       => 'Manipulate dates in various traditional Indian calendar systems.',
    dist_version        => '0.2',
    build_requires => {
        'DateTime'                      => 0,
        'DateTime::Event::Sunrise'      => 0,
        'DateTime::Util::Calc'          => 0.13,
        'Params::Validate'              => 0,
        'Test::More'                    => 0,
    },
    add_to_cleanup      => [ 'DateTime-Indic-*' ],
    meta_merge => {

Changes  view on Meta::CPAN

Revision history for DateTime-Indic

0.2     Mon Aug 17 01:25:54 EDT 2015
        Happy CPAN day!
        Various documentation fixes only.

0.1     Mon Jul 20 17:07:02 EDT 2009
        Initial Release.
        The following calendars are supported:
            South Indian Shalivahana Shaka
            Gujarati Vikrama Samvata
            Halari/Kutchhi Samvata

META.json  view on Meta::CPAN

{
   "abstract" : "Manipulate dates in various traditional Indian calendar systems.",
   "author" : [
      "Jaldhar H. Vyas <jaldhar@braincells.com>"
   ],
   "dynamic_config" : 1,
   "generated_by" : "Module::Build version 0.4204",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",

META.yml  view on Meta::CPAN

---
abstract: 'Manipulate dates in various traditional Indian calendar systems.'
author:
  - 'Jaldhar H. Vyas <jaldhar@braincells.com>'
build_requires:
  DateTime: 0
  DateTime::Event::Sunrise: 0
  DateTime::Util::Calc: 0.13
  Params::Validate: 0
  Test::More: 0
configure_requires:
  Module::Build: 0.42

README  view on Meta::CPAN

DateTime-Indic

This distribution consists of modules for manipulating dates in various 
traditional Indian calendar systems.  Currently the following calendars
are supported:

South Indian Shalivahana Shaka
Gujarati Vikrama Samvata
Halari/Kutchhi Samvata

INSTALLATION

If you have the Module::Signature module installed, you can verify the
integrity of this distribution by typing:

lib/DateTime/Calendar/HalariSamvata.pm  view on Meta::CPAN


    return 4;
}

1;

__END__

=head1 NAME

DateTime::Calendar::HalariSamvata - Halari/Kutchhi calendar.

=head1 VERSION

This documentation describes version 0.1 of this module.

=head1 SYNOPSIS

  use DateTime::Calendar::HalariSamvata;

  my $date = DateTime::Calendar::HalariSamvata->new(
    varsha => 2065,
    masa   => 4,
    paksha => 0,
    tithi  => 1,
  );
                
=head1 ABSTRACT

A module that implements the ChandramAna (luni-solar) calendar used in some 
Western parts of the Indian state of Gujarat.

=head1 DESCRIPTION

Note:  In this document, Sanskrit words are transliterated using the ITRANS
scheme.

The hAlArI saMvata started in the 3044th year of the current kali yuga.  The 
year begins on AShADha shukla 1 and months are amAsanta.

lib/DateTime/Calendar/ShalivahanaShaka/Southern.pm  view on Meta::CPAN


    return 3179;
}

1;

__END__

=head1 NAME

DateTime::Calendar::ShalivahanaShaka::Southern - South Indian calendar using 
shAlivAhana shaka era.

=head1 VERSION

This documentation describes version 0.1 of this module.

=head1 SYNOPSIS

  use DateTime::Calendar::ShalivahanaShaka::Southern;

  my $date = DateTime::Calendar::ShalivahanaShaka::Southern->new(
    varsha => 1931,
    masa   => 1,
    paksha => 0,
    tithi  => 1,
  );

=head1 ABSTRACT

A module that implements the ChandramAna (luni-solar) calendar used by people
originating in the Indian states of Maharashtra, Goa, Karnataka, and Andhra 
Pradesh.

=head1 DESCRIPTION

Note:  In this document, Sanskrit words are transliterated using the ITRANS
scheme.

The Southern shAlivAhana shaka started in the 3179th year of the current kali
yuga.  The year begins on chaitra shukla 1 and months are amAsanta.

lib/DateTime/Calendar/VikramaSamvata/Gujarati.pm  view on Meta::CPAN


    return 8;
}

1;

__END__

=head1 NAME

DateTime::Calendar::VikramaSamvata::Gujarati - Gujarati calendar using vikrama 
saMvata era.

=head1 VERSION

This documentation describes version 0.1 of this module.

=head1 SYNOPSIS

  use DateTime::Calendar::VikramaSamvata::Gujarati;

  my $date = DateTime::Calendar::VikramaSamvata::Gujarati->new(
    varsha => 2066,
    masa   => 8,
    paksha => 0,
    tithi  => 1,
  );
                
=head1 ABSTRACT

A module that implements the ChandramAna (luni-solar) calendar used by people
originating in the Indian state of Gujarat.

=head1 DESCRIPTION

Note:  In this document, Sanskrit words are transliterated using the ITRANS
scheme.

The Gujarati vikrama saMvata started in the 3044th year of the current kali
yuga.  The year begins on kArtika shukla 1 and months are amAsanta.

lib/DateTime/Indic/Chandramana.pm  view on Meta::CPAN

  lunar_on_or_before newmoon saura_rashi saura_varsha solar_longitude
  tithi_at_dt
  /;
use DateTime::Event::Sunrise;
use DateTime::Util::Calc qw/ amod dt_from_moment mod search_next /;
use Params::Validate qw/ validate BOOLEAN SCALAR OBJECT UNDEF /;
use POSIX qw/ floor /;

=head1 NAME

DateTime::Indic::Chandramana - Base class for Indian luni-solar calendars

=head1 VERSION

Version 0.2

=cut

our $VERSION = '0.2';

=head1 SYNOPSIS

This class is meant to be subclassed not used directly.

=head1 ABSTRACT

A module that implements an Indian chandramAna (luni-solar,) nirAyana 
(sidereal,) khagolasiddha (heliocentric,) and spaShTa (based on the true times 
of astronomical events) calendar.  The calendar described in this module isn't 
actually used as-is though; rather it is a basis for actual Indian luni-solar 
calendars which are implemented in other modules in the L<DateTime::Indic> 
collection.

=cut

my @varsha_nama = qw{ prabhava vibhava shukla pramoda prajApati a~ngirA
  shrImukha bhAva yuvA dhAtA ishvara bahudhAnya pramAthI vikrama vR^isha
  chitrabhAnu subhAnu tAraNa pArthiva vyaya sarvajit sarvadhArI virodhI
  vikrti khara nandana vijaya jaya manmatha durmukha hemalambi vilambi
  vikArI shArvarI plava shubhakrta shobhana krodhI vishvavAsu parAbhava
  plava~nga kIlaka saumya sAdharaNa virodhakrta paridhAvi pramAdi Ananda

lib/DateTime/Indic/Chandramana.pm  view on Meta::CPAN


my $purnima_abbrev = 'pU';

=head1 DESCRIPTION

Note:  In this document, Sanskrit words are transliterated using the ITRANS
scheme.

=head2 The Year (varSha)

All chandramAna calendars have as their epoch, the first day of the current 
kali yuga which is equivalent to Friday, January 23, -3101 BC in the proleptic 
Gregorian calendar. sidereal years (the time it takes for the sun to make one
pass through the entire zodiac) and days are counted off from this date to
perform calculations but the actual calendars in use, employ different eras to
number years.

=head2 The Lunar Month (mAsa)

chandramAna calendars consists of 12 lunar months (mAsa). A mAsa is defined as 
one complete phase cycle of the Moon. Some calendars use amAsanta mAsa which 
end on the day of the new moon.  Others use pUrNimAnta mAsa which end on the
day of the full moon.

The Sanskrit names of the mAsa and their approximate correspondence to 
Western months are:

  1  chaitra (March-April)            7  ashvina (September-October)
  2  vaishAkha (April-May)            8  kArtika (October-November)
  3  jyeShTa (May-June)               9  mArgashIrasa (November-December)
  4  AShADha (June-July)              10 pauSha (December-January)
  5  shrAvaNa (July-August)           11 mAgha (January-February)
  6  bhAdrapada (August-September)    12 phAlguna (February-March)

Some calendars start from a mAsa other than chaitra.  Nevertheless chaitra 
would still be considered the "first" month despite not being the first month 
of the year.

=head2 Leap and Omitted mAsa (adhikamAsa and kShayamAsa)

Because 12 mAsa can be a little bit more or less than a sidereal year, it is 
sometimes necessary to add or subtract a mAsa to keep the two synchronized.  
When the Sun spends an entire mAsa without entering another zodiacal sign,
the mAsa is called adhika ("leap") and it has the same name as the following 
month.  Very rarely, when the Sun enters two zodiacal signs in what would have 

lib/DateTime/Indic/Chandramana.pm  view on Meta::CPAN

  15 pUrNimA ("full moon")
  30 amAvasya ("new moon")

The tithi of a particular day is the one that prevails at sunrise on that day.  
(This is called the uditatithi.)

=head2 Leap and Omitted tithi (adhikatithi and kShayatithi)

Because the orbital speed of the Moon is not constant, sometimes a tithi can 
start and end entirely within one day.  In that case it is called a 
kShayatithi and it is omitted from the calendar.  Other times, one tithi 
stretches over two sunrises.  This is called a vR^iddha ("large") tithi.  In 
this case, both days have the same number and name.  The first is prefixed 
adhika or "leap".

=head2 Solar Day (vAra)

The Indian day does not start after midnight but at sunrise.  The period 
from sunrise to sunset is called ahasa ("day") and the period from sunset to 
the next sunrise is called rAtra ("night.") Together they make one ahorAtra or
vAra.  Each vAra has a name in a seven-day cycle. Thr Sanskrit names of the

lib/DateTime/Indic/Utils.pm  view on Meta::CPAN

  lunar_on_or_before
  newmoon
  saura_rashi
  saura_varsha
  solar_longitude
  tithi_at_dt
  /;

=head1 NAME

DateTime::Indic::Utils - Utility functions for Indian calendar calculation

=head1 VERSION

Version 0.3

=cut

our $VERSION = '0.3';

=head1 SYNOPSIS

lib/DateTime/Indic/Utils.pm  view on Meta::CPAN

  my $rashi = saura_rashi(J1900);
  
  my $year = saura_varsha($dt);
  
  my $lunar_day = tithi_at_dt($dt);


=head1 ABSTRACT

A collection of utility functions and constants helpful in creating Indian 
calendars.

=head1 DESCRIPTION

Note:  In this document, Sanskrit words are transliterated using the ITRANS
scheme.

These functions and constants were not included directly in 
L<DateTime::Indic::Chandramana> as they are more useful stand-alone. None of 
them are exported by default.



( run in 0.499 second using v1.01-cache-2.11-cpan-5dc5da66d9d )