diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-06-09 16:38:49 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-06-15 14:47:04 +0200 |
commit | d9238ee6c0a0bea45b82638d04a913441344ffcf (patch) | |
tree | ce520d3b4ba597909baea9d23e10dd21c050fa29 /app | |
parent | fc7cb8d1168a1304716cd9d63a7590362e873b31 (diff) | |
download | gitlab-ce-d9238ee6c0a0bea45b82638d04a913441344ffcf.tar.gz |
Translate time tooltips.
Let the backend do the translation.
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/lib/utils/datetime_utility.js | 2 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js index 54c0da3fc9c..bfcc50996cc 100644 --- a/app/assets/javascripts/lib/utils/datetime_utility.js +++ b/app/assets/javascripts/lib/utils/datetime_utility.js @@ -34,7 +34,7 @@ window.dateFormat = dateFormat; w.gl.utils.localTimeAgo = function($timeagoEls, setTimeago = true) { $timeagoEls.each((i, el) => { - el.setAttribute('title', gl.utils.formatDate(el.getAttribute('datetime'))); + el.setAttribute('title', el.getAttribute('title')); if (setTimeago) { // Recreate with custom template diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2bfc7586adc..99e2f8c6bca 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -167,9 +167,9 @@ module ApplicationHelper css_classes = short_format ? 'js-short-timeago' : 'js-timeago' css_classes << " #{html_class}" unless html_class.blank? - element = content_tag :time, time.strftime("%b %d, %Y"), + element = content_tag :time, l(time, format: "%b %d, %Y"), class: css_classes, - title: time.to_time.in_time_zone.to_s(:medium), + title: l(time.to_time.in_time_zone, format: :short), datetime: time.to_time.getutc.iso8601, data: { toggle: 'tooltip', |