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::Asset::File is a file storage backend for HTTP content.

EVENTS

Mojo::Asset::File inherits all events from Mojo::Asset.

ATTRIBUTES

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

locale

my $locale = $file->locale;
$locale    = $file->locale($locale);

Locale, defaults to the en_gb. See DateTime::Locale for more details.

time_zone

my $time_zone = $file->time_zone;
$time_zone    = $file->time_zone($time_zone);

Timezone, defaults to the Europe/London. See DateTime::TimeZone for more details.

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 ago datetime object.

firt_day_of_next_month

my $datetime = $calendar->firt_day_of_next_month;

First day of next month datetime object.

months_ago

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

3 months ago datetime object.

today

my $datetime = $calendar->today;

today datetime object.

tomorrow

my $datetime = $calendar->tomorrow;

tomorrow datetime object.

yesterday

my $datetime = $calendar->yesterday;

yesterday datetime object.

SEE ALSO

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