mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 14:45:56 +08:00
Fix Excell date parsing [SCI-10856]
This commit is contained in:
parent
0bdf220b20
commit
648b5be1b9
|
@ -264,6 +264,7 @@ class RepositoriesController < ApplicationController
|
|||
parsed_file = ImportRepository::ParseRepository.new(
|
||||
file: import_params[:file],
|
||||
repository: @repository,
|
||||
date_format: current_user.settings['date_format'],
|
||||
session: session
|
||||
)
|
||||
if parsed_file.too_large?
|
||||
|
|
|
@ -60,7 +60,9 @@ class SpreadsheetParser
|
|||
if cell.is_a?(Roo::Excelx::Cell::Number) && cell.format == 'General'
|
||||
cell&.value&.to_d
|
||||
elsif date_format && cell&.value.is_a?(Date)
|
||||
cell&.value&.strftime(date_format)
|
||||
cell&.value&.strftime(
|
||||
"#{date_format} #{' %H:%M' if cell.value.is_a?(DateTime)}"
|
||||
)
|
||||
else
|
||||
cell&.formatted_value
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue