diff options
author | Byron Jones <bjones@mozilla.com> | 2013-10-23 18:44:05 +0200 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-10-23 18:44:05 +0200 |
commit | 1128ed4a3267b1e160125eed520202e1fe0ed5c4 (patch) | |
tree | d6c2cbc685e2509c247362fefc40bd08a93d1056 /extensions/UserProfile/Extension.pm | |
parent | 4f6724b0f86ccffa091ca33c04e237b9dd5d4c4a (diff) | |
download | bugzilla-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.pm | 10 |
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)}; |