mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-09 14:13:16 +08:00
Change datetime to human friendly format for ZIP exports [SCI-2817]
This commit is contained in:
parent
159f6d1ee2
commit
d65fcdc312
2 changed files with 5 additions and 4 deletions
|
@ -19,11 +19,12 @@ class TeamZipExport < ZipExport
|
|||
def generate_exportable_zip(user, data, type, options = {})
|
||||
@user = user
|
||||
zip_input_dir = FileUtils.mkdir_p(
|
||||
File.join(Rails.root, "tmp/temp-zip-#{Time.now.to_i}")
|
||||
File.join(Rails.root, "tmp/temp_zip_#{Time.now.to_i}")
|
||||
).first
|
||||
zip_dir = FileUtils.mkdir_p(File.join(Rails.root, 'tmp/zip-ready')).first
|
||||
zip_file = File.new(
|
||||
File.join(zip_dir, "projects-export-#{Time.now.to_i}.zip"),
|
||||
File.join(zip_dir,
|
||||
"projects_export_#{Time.now.strftime('%F_%H-%M-%S')}.zip"),
|
||||
'w+'
|
||||
)
|
||||
fill_content(zip_input_dir, data, type, options)
|
||||
|
|
|
@ -50,11 +50,11 @@ class ZipExport < ApplicationRecord
|
|||
|
||||
def generate_exportable_zip(user, data, type, options = {})
|
||||
zip_input_dir = FileUtils.mkdir_p(
|
||||
File.join(Rails.root, "tmp/temp-zip-#{Time.now.to_i}")
|
||||
File.join(Rails.root, "tmp/temp_zip_#{Time.now.to_i}")
|
||||
).first
|
||||
zip_dir = FileUtils.mkdir_p(File.join(Rails.root, 'tmp/zip-ready')).first
|
||||
zip_file = File.new(
|
||||
File.join(zip_dir, "export-#{Time.now.to_i}.zip"),
|
||||
File.join(zip_dir, "export_#{Time.now.strftime('%F %H-%M-%S')}.zip"),
|
||||
'w+'
|
||||
)
|
||||
fill_content(zip_input_dir, data, type, options)
|
||||
|
|
Loading…
Reference in a new issue