summaryrefslogtreecommitdiffstats
path: root/extensions/UserProfile/Extension.pm
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-10-23 18:44:05 +0200
committerByron Jones <bjones@mozilla.com>2013-10-23 18:44:05 +0200
commit1128ed4a3267b1e160125eed520202e1fe0ed5c4 (patch)
treed6c2cbc685e2509c247362fefc40bd08a93d1056 /extensions/UserProfile/Extension.pm
parent4f6724b0f86ccffa091ca33c04e237b9dd5d4c4a (diff)
downloadbugzilla-1128ed4a3267b1e160125eed520202e1fe0ed5c4.tar.gz
bugzilla-1128ed4a3267b1e160125eed520202e1fe0ed5c4.tar.xz
Bug 924144: Add account creation date to user profile
Diffstat (limited to 'extensions/UserProfile/Extension.pm')
-rw-r--r--extensions/UserProfile/Extension.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/extensions/UserProfile/Extension.pm b/extensions/UserProfile/Extension.pm
index 189e91f65..99f235896 100644
--- a/extensions/UserProfile/Extension.pm
+++ b/extensions/UserProfile/Extension.pm
@@ -13,9 +13,11 @@ use warnings;
use base qw(Bugzilla::Extension);
use Bugzilla::Constants;
+use Bugzilla::Extension::UserProfile::TimeAgo qw(time_ago);
use Bugzilla::Extension::UserProfile::Util;
use Bugzilla::Install::Filesystem;
use Bugzilla::User;
+use Bugzilla::Util qw(datetime_from);
use Scalar::Util qw(blessed);
our $VERSION = '1';
@@ -261,6 +263,14 @@ sub webservice_user_get {
}
}
+sub template_before_create {
+ my ($self, $args) = @_;
+ $args->{config}->{FILTERS}->{timeago} = sub {
+ my ($time_str) = @_;
+ return time_ago(datetime_from($time_str, 'UTC'));
+ };
+}
+
sub page_before_template {
my ($self, $args) = @_;
my ($vars, $page) = @$args{qw(vars page_id)};