Skip to content

Commit

Permalink
proper serialization of time
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed Jun 15, 2024
1 parent a9f5098 commit 067f0e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
tokio = { version = "1.37", default-features = false, features = ["macros", "rt-multi-thread", "net", "fs", "sync", "time"] }
reqwest = { version = "0.12", features = ["json", "rustls-tls-webpki-roots"], default-features = false }
axum = { version = "0.7", default-features = false, features = ["tokio", "http1", "json", "query","macros"] }
time = { version = "0.3", default-features = false, features = ["serde", "std", "formatting"] }
time = { version = "0.3", default-features = false, features = ["serde", "std", "formatting", "parsing"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi"] }
tower-http = { version = "0.5", default-features = false, features = ["cors", "fs"] }
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
Expand Down
6 changes: 6 additions & 0 deletions src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ pub(crate) struct Events {
#[derive(Deserialize)]
pub(crate) struct EventMeta {
title: String,
#[serde(deserialize_with = "time::serde::iso8601::deserialize")]
start_time: OffsetDateTime,
#[serde(deserialize_with = "time::serde::iso8601::deserialize")]
end_time: OffsetDateTime,
location: String,
description: String,
Expand All @@ -31,7 +33,9 @@ pub(crate) struct Event {
lang: Language,
idx: u32,
title: String,
#[serde(serialize_with = "time::serde::iso8601::serialize")]
start_time: OffsetDateTime,
#[serde(serialize_with = "time::serde::iso8601::serialize")]
end_time: OffsetDateTime,
location: String,
description: String,
Expand All @@ -46,7 +50,9 @@ pub(crate) struct SmallEvent {
lang: Language,
idx: u32,
title: String,
#[serde(serialize_with = "time::serde::iso8601::serialize")]
start_time: OffsetDateTime,
#[serde(serialize_with = "time::serde::iso8601::serialize")]
end_time: OffsetDateTime,
location: String,
description: String,
Expand Down

0 comments on commit 067f0e1

Please sign in to comment.