NAME
Mojolicious::Plugin::TimeAgo - TimeAgo Mojolicious Plugin
SYNOPSIS
# Mojolicious
$self->plugin('TimeAgo');
# Mojolicious::Lite
plugin 'TimeAgo';
DESCRIPTION
Mojolicious::Plugin::TimeAgo is a Mojolicious plugin that provide a feature to convert DateTime objects to "just now" string, for example.
METHODS
Mojolicious::Plugin::TimeAgo inherits all methods from Mojolicious::Plugin and implements the following new ones.
register
$plugin->register(Mojolicious->new);
Register plugin in Mojolicious application.
time_ago([DateTime obj])
# Mojolicious::Controller
my $date = $self->time_ago( DateTime->now );
or ...
# view template
%= time_ago DateTime->now
<%= time_ago DateTime->now %>
TODO
* Language support
* Get and use language by stash
* Integration with I18N mojolicious plugin
AUTHOR
Daniel Vinciguerra <daniel.vinciguerra@bivee.com.br>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Daniel Vinciguerra (dvinci@cpan.org).
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.