NAME

Mojo::Calendar - Extended DateTime manipulator

SYNOPSIS

    use Mojo::Calendar;

    # Calendar with default date being now
    my $calendar = Mojo::Calendar->new;

    say $calendar->ymd;
    say $calendar->his;

    say $calendar->tomorrow->ymd;

    # Calendar with default date being now
    my $calendar = Mojo::Calendar->new;

    say $calendar->ymd;
    say $calendar->his;

    # Calendar with default date being 2019-03-28 15:29:00
    my $calendar = Mojo::Calendar->new('2019-03-28 15:29:00');

    say $calendar->ymd;
    say $calendar->his;

DESCRIPTION

Mojo::Calendar is a DateTime manipulator which includes humman readable methods.

ATTRIBUTES

Mojo::Calendar inherits all attributes from DateTime.

METHODS

Mojo::Calendar inherits all methods from DateTime and implements the following new ones.

new

    my $datetime = Mojo::Calendar->new;

Calendar object.

days_ago

    my $datetime = $calendar->days_ago(2);

2 days since initial datetime.

days_from_now

    my $datetime = $calendar->days_from_now(2);

2 days from initial datetime.

first_day_of_next_month

    my $datetime = $calendar->first_day_of_next_month;

First day of next month from initial datetime.

first_day_of_prev_month

    my $datetime = $calendar->first_day_of_prev_month;

First day of previous month from initial datetime.

months_ago

    my $datetime = $calendar->months_ago(3);

3 months since initial datetime.

months_from_now

    my $datetime = $calendar->months_from_now(3);

3 months from initial datetime.

today

    my $datetime = $calendar->today;

today based on initial datetime.

tomorrow

    my $datetime = $calendar->tomorrow;

tomorrow based on initial datetime.

yesterday

    my $datetime = $calendar->yesterday;

yesterday based on initial datetime.

SEE ALSO

DateTime, Mojolicious, Mojolicious::Guides, https://mojolicious.org.