aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/api_entity_crud.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-11-14 18:52:48 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-11-14 18:52:50 -0800
commit54c4b6cd67c7f8190dc7dfb4da6ad99dc2101c82 (patch)
treef121a1deebef99a639ff82bc241eb44f2d5bc8ef /rust/src/api_entity_crud.rs
parent610b0a6550c758529cf6c34587f45e483a240df4 (diff)
downloadfatcat-54c4b6cd67c7f8190dc7dfb4da6ad99dc2101c82.tar.gz
fatcat-54c4b6cd67c7f8190dc7dfb4da6ad99dc2101c82.zip
fix date/datetime confusion on rust/API side
Should have dug in to this earlier; python code was getting confused. This is a breaking API change, from a practical standpoint, as both python and rust code had been hacked to work around this.
Diffstat (limited to 'rust/src/api_entity_crud.rs')
-rw-r--r--rust/src/api_entity_crud.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/rust/src/api_entity_crud.rs b/rust/src/api_entity_crud.rs
index 258355f8..f8e3a0ed 100644
--- a/rust/src/api_entity_crud.rs
+++ b/rust/src/api_entity_crud.rs
@@ -1,6 +1,5 @@
use api_helpers::*;
use api_server::get_release_files;
-use chrono;
use database_models::*;
use database_schema::*;
use diesel::prelude::*;
@@ -833,9 +832,7 @@ impl EntityCrud for ReleaseEntity {
title: rev_row.title,
release_type: rev_row.release_type,
release_status: rev_row.release_status,
- release_date: rev_row
- .release_date
- .map(|v| chrono::DateTime::from_utc(v.and_hms(0, 0, 0), chrono::Utc)),
+ release_date: rev_row.release_date,
doi: rev_row.doi,
pmid: rev_row.pmid,
pmcid: rev_row.pmcid,
@@ -891,7 +888,7 @@ impl EntityCrud for ReleaseEntity {
title: model.title.clone(),
release_type: model.release_type.clone(),
release_status: model.release_status.clone(),
- release_date: model.release_date.map(|v| v.naive_utc().date()),
+ release_date: model.release_date,
doi: model.doi.clone(),
pmid: model.pmid.clone(),
pmcid: model.pmcid.clone(),