diff --git a/src/statistics/database.rs b/src/statistics/database.rs index f02c8d0..e5aba71 100644 --- a/src/statistics/database.rs +++ b/src/statistics/database.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use chrono::{DateTime, Utc}; +use chrono::{DateTime, NaiveDate, Utc}; use chrono_tz::Tz; use clickhouse_rs::{row, Block, Pool}; use tracing::warn; @@ -407,7 +407,7 @@ impl StatisticDatabaseController { let rows = result.rows(); let mut data = Vec::new(); for row in rows { - let date: DateTime = row.get("date")?; + let date: NaiveDate = row.get("date")?; let value: u64 = row.get("value")?; data.push(Datapoint { date, value }); } diff --git a/src/statistics/model.rs b/src/statistics/model.rs index 20b580a..6af2005 100644 --- a/src/statistics/model.rs +++ b/src/statistics/model.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use chrono::DateTime; +use chrono::NaiveDate; use chrono::Utc; -use chrono_tz::Tz; use clickhouse_rs::Pool; use serde::{Deserialize, Serialize}; use uuid::Uuid; @@ -138,7 +138,7 @@ pub struct StatisticCounts { #[derive(Serialize)] pub struct Datapoint { - pub date: DateTime, + pub date: NaiveDate, pub value: u64, }