Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
199
Issues
199
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
8251904e
Verified
Commit
8251904e
authored
Apr 08, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[zip] fix timezone of the zipped file
parent
871aced4
Pipeline
#5882
canceled with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
cabal.project
cabal.project
+1
-1
Export.hs
src/Gargantext/API/Node/Document/Export.hs
+5
-1
No files found.
cabal.project
View file @
8251904e
...
@@ -172,7 +172,7 @@ source-repository-package
...
@@ -172,7 +172,7 @@ source-repository-package
type
:
git
type
:
git
location
:
https
://
github
.
com
/
robstewart57
/
rdf4h
.
git
location
:
https
://
github
.
com
/
robstewart57
/
rdf4h
.
git
tag
:
4f
d2edf30c141600ffad6d730cc4c1c08a6dbce4
tag
:
4f
d2edf30c141600ffad6d730cc4c1c08a6dbce4
allow
-
older
:
*
allow
-
older
:
*
allow
-
newer
:
*
allow
-
newer
:
*
...
...
src/Gargantext/API/Node/Document/Export.hs
View file @
8251904e
...
@@ -29,6 +29,7 @@ import Gargantext.Database.Schema.Node (NodePoly(..), node_user_id)
...
@@ -29,6 +29,7 @@ import Gargantext.Database.Schema.Node (NodePoly(..), node_user_id)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Paths_gargantext
qualified
as
PG
-- cabal magic build module
import
Paths_gargantext
qualified
as
PG
-- cabal magic build module
import
Servant
(
addHeader
,
(
:<|>
)((
:<|>
)),
Header
,
Headers
(
getResponse
)
)
import
Servant
(
addHeader
,
(
:<|>
)((
:<|>
)),
Header
,
Headers
(
getResponse
)
)
import
Data.Time.LocalTime
(
getCurrentTimeZone
,
TimeZone
(
timeZoneMinutes
))
api
::
NodeId
api
::
NodeId
-- ^ The ID of the target user
-- ^ The ID of the target user
...
@@ -81,10 +82,13 @@ getDocumentsJSONZip :: NodeId
...
@@ -81,10 +82,13 @@ getDocumentsJSONZip :: NodeId
getDocumentsJSONZip
userNodeId
pId
=
do
getDocumentsJSONZip
userNodeId
pId
=
do
dJSON
<-
getDocumentsJSON
userNodeId
pId
dJSON
<-
getDocumentsJSON
userNodeId
pId
systime
<-
liftBase
getSystemTime
systime
<-
liftBase
getSystemTime
tz
<-
liftBase
getCurrentTimeZone
let
dexp
=
getResponse
dJSON
let
dexp
=
getResponse
dJSON
let
dexpz
=
DocumentExportZIP
{
_dez_dexp
=
dexp
let
dexpz
=
DocumentExportZIP
{
_dez_dexp
=
dexp
,
_dez_doc_id
=
pId
,
_dez_doc_id
=
pId
,
_dez_last_modified
=
fromIntegral
$
systemSeconds
systime
}
-- see https://github.com/jgm/zip-archive/commit/efe4423a9a2b1dc2a4d413917a933828d3f8dc0f
,
_dez_last_modified
=
fromIntegral
(
systemSeconds
systime
)
+
fromIntegral
(
timeZoneMinutes
tz
*
60
)
}
pure
$
addHeader
(
T
.
concat
[
"attachment; filename="
pure
$
addHeader
(
T
.
concat
[
"attachment; filename="
,
dezFileName
dexpz
,
dezFileName
dexpz
,
".zip"
])
dexpz
,
".zip"
])
dexpz
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment