Yasuhiro Horiuchi > Date-Simple-Month-0.02 > Date::Simple::Month

Download:
Date-Simple-Month-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Date::Simple::Month - a month of Date::Simple objects

SYNOPSIS ^

  use Date::Simple::Month;

    my $month = Date::Simple::Month->new(Date::Simple $ds); # the month includes $ds
    my $month = Date::Simple::Month->new(); # this year, this month
    my $month = Date::Simple::Month->new(int $month); # this year, $month
    my $month = Date::Simple::Month->new(int $year, int $month); # $year, $month
    
    my Date::Simple::Month $prev = $month->prev_month;
    my Date::Simple::Month $next = $month->next_month;
    
    my $cur_year   = $month->year;
    my $cur_month  = $month->month;
    
    my @dates = $month->dates;
    my @wraparound_dates = $month->wraparound_dates; # From Sunday (default)
    my @wraparound_dates_from_monday = $month->wraparound_dates(1);
    my @wraparound_dates_from_tuesday = $month->wraparound_dates(2);

DESCRIPTION ^

Date::Simple::Month is a subclass of Date::Range that represents a complete calendar month consisted of Date::Simple objects.

METHOD ^

new

    my $month = Date::Simple::Month->new(Date::Simple $ds); # the month includes $ds
    my $month = Date::Simple::Month->new(); # this year, this month
    my $month = Date::Simple::Month->new(int $month); # this year, $month
    my $month = Date::Simple::Month->new(int $year, int $month); # $year, $month

note: This constructor return undef if this couldn't parse date.

prev_month / next_month

    my Date::Simple::Month $prev = $month->prev_month;
    my Date::Simple::Month $next = $month->next_month;

The next and previous months.

year / month

    my $cur_year  = $month->year;
    my $cur_month = $month->month;

year and month of the object.

dates

    my @dates = $month->dates;

a list of Date::Simple objecs representing each day in the month.

wraparound_dates

    my @wraparound_dates = $month->wraparound_dates; # From Sunday (default)
    my @wraparound_dates_from_monday = $month->wraparound_dates(1);
    my @wraparound_dates_from_tuesday = $month->wraparound_dates(2);
    .....

a list of Date::Simple objecs representing each day in the month including the days on either side that ensure that the full list runs. The start day of week can control by argument. If no argument is given a list starts from Sunday.

AUTHOR ^

Yasuhiro Horiuchi <horiuchi@vcube.com>

SEE ALSO ^

Time::Piece::Month,Date::Range,Date::Simple

syntax highlighting: