line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::DateTime; |
2
|
2
|
|
|
2
|
|
156057
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
14
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Mojolicious plugin to DateTime module integration |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
1730
|
use DateTime; |
|
2
|
|
|
|
|
98489
|
|
|
2
|
|
|
|
|
297
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub register { |
10
|
1
|
|
|
1
|
1
|
51
|
my ( $self, $app ) = @_; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# datetime method helper |
13
|
|
|
|
|
|
|
$app->helper( |
14
|
|
|
|
|
|
|
datetime => sub { |
15
|
3
|
|
|
3
|
|
52812
|
my $self = shift; |
16
|
3
|
|
|
|
|
29
|
return DateTime->new(@_); |
17
|
|
|
|
|
|
|
} |
18
|
1
|
|
|
|
|
11
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# datetime short way |
21
|
|
|
|
|
|
|
$app->helper( |
22
|
|
|
|
|
|
|
dt => sub { |
23
|
1
|
|
|
1
|
|
17292
|
return shift->datetime(@_); |
24
|
|
|
|
|
|
|
} |
25
|
1
|
|
|
|
|
85
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# datetime now method call |
28
|
|
|
|
|
|
|
$app->helper( |
29
|
|
|
|
|
|
|
now => sub { |
30
|
1
|
|
|
1
|
|
13073
|
my $self = shift; |
31
|
1
|
|
|
|
|
9
|
return DateTime->now(@_); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
) |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
55
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |