aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/View/Web.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/View/Web.pm')
-rw-r--r--perllib/FixMyStreet/App/View/Web.pm20
1 files changed, 19 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/View/Web.pm b/perllib/FixMyStreet/App/View/Web.pm
index c8240948d..cbb68df0d 100644
--- a/perllib/FixMyStreet/App/View/Web.pm
+++ b/perllib/FixMyStreet/App/View/Web.pm
@@ -15,7 +15,9 @@ __PACKAGE__->config(
],
ENCODING => 'utf8',
render_die => 1,
- expose_methods => [ 'loc', 'nget', 'tprintf', 'display_crossell_advert' ],
+ expose_methods => [
+ 'loc', 'nget', 'tprintf', 'display_crossell_advert', 'prettify_epoch',
+ ],
);
=head1 NAME
@@ -87,5 +89,21 @@ sub display_crossell_advert {
return CrossSell::display_advert( $q, $email, $name );
}
+=head2 Page::prettify_epoch
+
+ [% pretty = prettify_epoch( $epoch, $short_bool ) %]
+
+Return a pretty version of the epoch.
+
+ $short_bool = 1; # 16:02, 29 Mar 2011
+ $short_bool = 0; # 16:02, Tuesday 29 March 2011
+
+=cut
+
+sub prettify_epoch {
+ my ( $self, $c, $epoch, $short_bool ) = @_;
+ return Page::prettify_epoch( $c->req, $epoch, $short_bool );
+}
+
1;