Skip to content

Commit

Permalink
Made datetime rfc
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecardleitao committed Feb 26, 2024
1 parent 130a304 commit 022afd5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions examples/etl_legs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ static DATABASE: &'static str = "leg/v1/data/";
struct LegOut {
tail_number: String,
model: String,
start: String,
end: String,
#[serde(with = "time::serde::rfc3339")]
start: time::OffsetDateTime,
#[serde(with = "time::serde::rfc3339")]
end: time::OffsetDateTime,
from_lat: f64,
from_lon: f64,
to_lat: f64,
Expand Down Expand Up @@ -76,8 +78,8 @@ async fn write(
LegOut {
tail_number: aircraft.tail_number.to_string(),
model: aircraft.model.to_string(),
start: leg.from().datetime().to_string(),
end: leg.to().datetime().to_string(),
start: leg.from().datetime(),
end: leg.to().datetime(),
from_lat: leg.from().latitude(),
from_lon: leg.from().longitude(),
to_lat: leg.to().latitude(),
Expand Down Expand Up @@ -175,7 +177,7 @@ async fn main() -> Result<(), Box<dyn Error>> {

let models = flights::load_private_jet_models()?;

let months = (2023..2024).cartesian_product(1..=12u8).count();
let months = (2020..2024).cartesian_product(1..=12u8).count();
let relevant_jets = private_jets(Some(&client), cli.country.as_deref())
.await?
.into_iter()
Expand Down

0 comments on commit 022afd5

Please sign in to comment.