diff options
Diffstat (limited to '')
-rw-r--r-- | src/iceportal.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/iceportal.rs b/src/iceportal.rs index a81d5d3..0d2076e 100644 --- a/src/iceportal.rs +++ b/src/iceportal.rs @@ -1,4 +1,4 @@ -use chrono::NaiveDateTime; +use chrono::{DateTime, NaiveDateTime, Utc}; use serde::Deserialize; use serde_json::Value; @@ -48,10 +48,10 @@ struct Station { #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] struct Timetable { - #[serde(deserialize_with = "option_naive_read_unixtime")] - scheduled_arrival_time: Option<NaiveDateTime>, - #[serde(deserialize_with = "option_naive_read_unixtime")] - actual_arrival_time: Option<NaiveDateTime> + #[serde(deserialize_with = "option_naive_read_unixtime_db")] + scheduled_arrival_time: Option<DateTime<Utc>>, + #[serde(deserialize_with = "option_naive_read_unixtime_db")] + actual_arrival_time: Option<DateTime<Utc>> } impl IsStation for Stop { @@ -59,12 +59,12 @@ impl IsStation for Stop { &self.station.name } - fn scheduled_arrival (&self) -> Option<&chrono::NaiveDateTime> { + fn scheduled_arrival (&self) -> Option<&chrono::DateTime<Utc>> { self.timetable.scheduled_arrival_time.as_ref() } - fn real_arrival (&self) -> Option<&chrono::NaiveDateTime> { - self.timetable.actual_arrival_time.as_ref() + fn real_arrival (&self) -> Option<&chrono::DateTime<Utc>> { + self.timetable.scheduled_arrival_time.as_ref() } fn ds100 (&self) -> &str { |