diff --git a/Gemfile b/Gemfile index 0125a12..72445c2 100644 --- a/Gemfile +++ b/Gemfile @@ -18,6 +18,7 @@ gem 'autoprefixer-rails', '~> 6' gem 'settingslogic', '~> 2.0.9' gem 'turbolinks', '~> 5' gem 'uglifier', '>= 1.3.0' +gem 'local_time' # Foundation for Emails gem 'inky-rb', require: 'inky' diff --git a/Gemfile.lock b/Gemfile.lock index ecf5026..e4a9a3b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,6 +58,13 @@ GEM byebug (9.0.6) choice (0.2.0) coderay (1.1.1) + coffee-rails (4.2.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.2.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) concurrent-ruby (1.0.5) css_parser (1.4.9) addressable @@ -139,6 +146,8 @@ GEM rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) + local_time (1.0.3) + coffee-rails loofah (2.0.3) nokogiri (>= 1.5.9) lumberjack (1.0.11) @@ -325,6 +334,7 @@ DEPENDENCIES json (~> 2.0.2) kaminari listen + local_time mailjet (~> 1.3.8) minitest-reporters mysql2 (>= 0.3.18, < 0.5) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d947126..b5d7c6c 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,3 +14,4 @@ //= require jquery_ujs //= require turbolinks //= require modernizr-lite/modernizr +//= require local_time diff --git a/app/views/admin/result/_comment.html.erb b/app/views/admin/result/_comment.html.erb index 13c5674..6e836cb 100644 --- a/app/views/admin/result/_comment.html.erb +++ b/app/views/admin/result/_comment.html.erb @@ -6,9 +6,9 @@ <% end %> <% if comment.edits? %> -
Updated <%= time_ago_in_words(comment.updated_at) %> ago
+
Updated <%= local_time_ago(comment.updated_at) %>
<% else %> -
<%= time_ago_in_words(comment.created_at) %> ago
+
<%= local_time_ago(comment.created_at) %>
<% end %>