Browse Source

+ LDV::Helpers->from_unixtime

master
Alex 'AdUser' Z 9 years ago
parent
commit
71a7ba52e5
  1. 6
      lib/LDV/Helpers.pm

6
lib/LDV/Helpers.pm

@ -6,6 +6,7 @@ use utf8;
use Mojo::Base 'Mojolicious::Plugin'; use Mojo::Base 'Mojolicious::Plugin';
use POSIX qw(strftime);
use Text::Markdown; use Text::Markdown;
sub register { sub register {
@ -22,6 +23,11 @@ sub register {
$text =~ s{\r?\n}{<br/>}go; $text =~ s{\r?\n}{<br/>}go;
return $text; return $text;
}); });
$app->helper(from_unixtime => sub {
my ($c, $unixtime) = @_;
return strftime("%Y-%m-%d %H:%M", localtime($unixtime));
});
} }
1; 1;

Loading…
Cancel
Save