From 838455af0d7a7d02c5145eed6fde0de9aaeff5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Zrim=C5=A1ek?= Date: Sat, 12 Jan 2019 19:28:45 +0100 Subject: [PATCH] Fix protocols.io Date handling at import --- app/helpers/protocols_io_helper.rb | 4 ++-- .../_import_json_protocol_preview_modal.html.erb | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/helpers/protocols_io_helper.rb b/app/helpers/protocols_io_helper.rb index 0bf7b6a0d..db52f3df1 100644 --- a/app/helpers/protocols_io_helper.rb +++ b/app/helpers/protocols_io_helper.rb @@ -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 diff --git a/app/views/protocols/import_export/_import_json_protocol_preview_modal.html.erb b/app/views/protocols/import_export/_import_json_protocol_preview_modal.html.erb index 72dac3dd4..8bbc35326 100644 --- a/app/views/protocols/import_export/_import_json_protocol_preview_modal.html.erb +++ b/app/views/protocols/import_export/_import_json_protocol_preview_modal.html.erb @@ -60,9 +60,7 @@ <% 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" %>