line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::DateSimple; |
2
|
1
|
|
|
1
|
|
602
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
375
|
use Date::Simple::D8; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub register { |
9
|
|
|
|
|
|
|
my ($self, $app, $conf) = @_; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
if ( $conf->{FMT} =~ /^d8$/i ) { |
12
|
|
|
|
|
|
|
$app->helper( |
13
|
|
|
|
|
|
|
'datesimple.d8' => sub { |
14
|
|
|
|
|
|
|
my $self = shift; |
15
|
|
|
|
|
|
|
return Date::Simple::D8->new(@_); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
} else { |
19
|
|
|
|
|
|
|
$app->helper( |
20
|
|
|
|
|
|
|
'datesimple' => sub { |
21
|
|
|
|
|
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
return Date::Simple->new(@_); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
__END__ |