diff options
author | Annabel Dunstone <annabel.dunstone@gmail.com> | 2016-07-12 17:52:36 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-08-04 15:01:37 -0500 |
commit | 9955dc29a863ad997efe2926875c29f963ba94d4 (patch) | |
tree | 963604be4cd8b73ae9be90d3c705e2555fd897ec /app/helpers/application_helper.rb | |
parent | 6df51b35d598a3ec553100323c0f0611e1e3d1e1 (diff) | |
download | gitlab-ce-9955dc29a863ad997efe2926875c29f963ba94d4.tar.gz |
Update timeago to shorter representation19752-pipelines-finished-at
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 50de93d4bdf..c3613bc67dd 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -163,9 +163,13 @@ module ApplicationHelper # `html_class` argument is provided. # # Returns an HTML-safe String - def time_ago_with_tooltip(time, placement: 'top', html_class: 'time_ago', skip_js: false) + def time_ago_with_tooltip(time, placement: 'top', html_class: '', skip_js: false, short_format: false) + css_classes = short_format ? 'js-short-timeago' : 'js-timeago' + css_classes << " #{html_class}" unless html_class.blank? + css_classes << ' js-timeago-pending' unless skip_js + element = content_tag :time, time.to_s, - class: "#{html_class} js-timeago #{"js-timeago-pending" unless skip_js}", + class: css_classes, datetime: time.to_time.getutc.iso8601, title: time.to_time.in_time_zone.to_s(:medium), data: { toggle: 'tooltip', placement: placement, container: 'body' } |