Fix protocols.io Date handling at import

This commit is contained in:
Matej Zrimšek 2019-01-12 19:28:45 +01:00
parent 8070b7f8b5
commit 838455af0d
2 changed files with 3 additions and 5 deletions

View file

@ -161,9 +161,9 @@ module ProtocolsIoHelper
timestamps = steps.map do |step|
step['modified_on'] if step['modified_on'].present?
end
I18n.l(Time.at(timestamps.max), format: :full_with_tz)
I18n.l(Time.at(timestamps.max), format: :full)
rescue StandardError
I18n.l(Time.at(0), format: :full_with_tz)
I18n.l(Time.at(0), format: :full)
end
# Checks so that null values are returned as zero length strings

View file

@ -60,9 +60,7 @@
<label><%= t('protocols.import_export.import_modal.updated_at_label') %></label>
<% display_last_modified=eval_last_modified(@json_object['steps']) %>
<%= f.text_field :last_modified, :value =>
I18n.l(display_last_modified, format: :full), readonly: true, class:
"form-control" %>
<%= f.text_field :last_modified, :value => display_last_modified, readonly: true, class: "form-control" %>
</div>
</div>
</div>