diff --git a/app/views/answers/_status.html.erb b/app/views/answers/_status.html.erb index cc86ddd..27c8e48 100644 --- a/app/views/answers/_status.html.erb +++ b/app/views/answers/_status.html.erb @@ -4,6 +4,6 @@

<% if answer.updated_at.present? %>

- <%= _('Answered')%> <%= answer.updated_at.iso8601 %><%= _(' by')%> <%= answer.user.name %> + <%= _('Answered')%> <%= _(' by')%> <%= answer.user.name %>

<% end %> \ No newline at end of file diff --git a/lib/assets/.eslintrc.json b/lib/assets/.eslintrc.json index b2243c8..f15d382 100644 --- a/lib/assets/.eslintrc.json +++ b/lib/assets/.eslintrc.json @@ -3,5 +3,8 @@ "env": { "jasmine": true, "jquery": true + }, + "globals": { + "timeago": true } } diff --git a/lib/assets/javascripts/views/answers/status.js b/lib/assets/javascripts/views/answers/status.js index 83716a4..29fd110 100644 --- a/lib/assets/javascripts/views/answers/status.js +++ b/lib/assets/javascripts/views/answers/status.js @@ -1,4 +1,3 @@ -import timeago from 'timeago.js/dist/timeago'; import { isObject, isNumber, @@ -90,7 +89,7 @@ if (isNumber(data.question.id)) { if (isString(data.question.answer_status)) { $(`#answer-status-${data.question.id}`).html(data.question.answer_status); // TODO check partial render of this view on the server - timeago().render($('abbr.timeago')); + timeago().render($('time.timeago')); } if (isString(data.question.locking)) { $(`#answer-locking-${data.question.id}`).html(data.question.locking); @@ -118,5 +117,5 @@ }); } }); - timeago().render($('abbr.timeago')); + timeago().render($('time.timeago')); }); diff --git a/lib/assets/webpack.config.js b/lib/assets/webpack.config.js index 5d8ff3b..9113b1c 100644 --- a/lib/assets/webpack.config.js +++ b/lib/assets/webpack.config.js @@ -15,7 +15,7 @@ context: __dirname, entry: { - vendor: ['jquery', 'jquery-accessible-autocomplete-list-aria/jquery-accessible-autocomplete-list-aria'], + vendor: ['jquery', 'timeago.js', 'jquery-accessible-autocomplete-list-aria/jquery-accessible-autocomplete-list-aria'], application: ['./javascripts/application.js', './stylesheets/application.scss'], }, @@ -67,6 +67,7 @@ new webpack.ProvidePlugin({ // Load jquery module automatically instead of import everywhere jQuery: 'jquery', $: 'jquery', + timeago: 'timeago.js', }), new webpack.optimize.CommonsChunkPlugin({ name: 'vendor',