Fix dates on activities and experiments [SCI-2778]

This commit is contained in:
Oleksii Kriuchykhin 2018-11-12 10:26:48 +01:00
parent 8d0dbc7076
commit e89d60785f
2 changed files with 5 additions and 3 deletions

View file

@ -34,12 +34,14 @@ class ActivitiesController < ApplicationController
end
# send last activity date of the previus batch
previous_activity = Activity.find_by_id(params[:last_activity])
previus_date = previous_activity.created_at if previous_activity
if previous_activity&.created_at
previus_date = I18n.l(previous_activity.created_at, format: :full_date)
end
{
activities: activities,
more_activities_url: more_url,
page: page,
previous_activity_created_at: I18n.l(previus_date, format: :full_date)
previous_activity_created_at: previus_date
}
end
end

View file

@ -41,7 +41,7 @@
<% end %>
<span>
<span class="fas fa-calendar-alt" aria-hidden="true"></span>
<%= localize(experiment.created_at, format: t('time.formats.full_date')) %> - <%= localize(experiment.updated_at, format: t('time.formats.full_date')) %>
<%= l(experiment.created_at, format: :full_date) %> - <%= localize(experiment.updated_at, format: :full_date) %>
</span>
<div data-hook="experiment-card-body">
<% if experiment.description? %>