summaryrefslogtreecommitdiff
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-30 14:38:42 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-30 14:38:42 +0200
commit9a7e2399dd766bae96ed15b6e6d4c69374d310fe (patch)
treef09233c6311fa93fa327bd06441cac62bfde585e /app/helpers/application_helper.rb
parente2dbe0fad7f04826bde06ae9e8d16ca0bc8a2ce2 (diff)
downloadgitlab-ce-9a7e2399dd766bae96ed15b6e6d4c69374d310fe.tar.gz
Use jquery timeago plugin
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 7ca52598cfb..cd3afd5cc32 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -72,7 +72,7 @@ module ApplicationHelper
def last_commit(project)
if project.repo_exists?
- time_ago_with_tooltip(project.repository.commit.committed_date) + " ago"
+ time_ago_with_tooltip(project.repository.commit.committed_date)
else
"Never"
end
@@ -210,11 +210,11 @@ module ApplicationHelper
def time_ago_with_tooltip(date, placement = 'top', html_class = 'time_ago')
capture_haml do
- haml_tag :time, time_ago_in_words(date),
- class: html_class, datetime: date, title: date.stamp("Aug 21, 2011 9:23pm"),
+ haml_tag :time, date.to_s,
+ class: html_class, datetime: date.getutc.iso8601, title: date.stamp("Aug 21, 2011 9:23pm"),
data: { toggle: 'tooltip', placement: placement }
- haml_tag :script, "$('." + html_class + "').tooltip()"
+ haml_tag :script, "$('." + html_class + "').timeago().tooltip()"
end.html_safe
end
end