aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-common/src/api.rs
diff options
context:
space:
mode:
Diffstat (limited to 'atuin-common/src/api.rs')
-rw-r--r--atuin-common/src/api.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/atuin-common/src/api.rs b/atuin-common/src/api.rs
index 5622bd82..ddcc0b09 100644
--- a/atuin-common/src/api.rs
+++ b/atuin-common/src/api.rs
@@ -1,6 +1,6 @@
-use chrono::Utc;
use serde::{Deserialize, Serialize};
use std::borrow::Cow;
+use time::OffsetDateTime;
#[derive(Debug, Serialize, Deserialize)]
pub struct UserResponse {
@@ -36,7 +36,8 @@ pub struct LoginResponse {
#[derive(Debug, Serialize, Deserialize)]
pub struct AddHistoryRequest {
pub id: String,
- pub timestamp: chrono::DateTime<Utc>,
+ #[serde(with = "time::serde::rfc3339")]
+ pub timestamp: OffsetDateTime,
pub data: String,
pub hostname: String,
}
@@ -48,8 +49,10 @@ pub struct CountResponse {
#[derive(Debug, Serialize, Deserialize)]
pub struct SyncHistoryRequest {
- pub sync_ts: chrono::DateTime<chrono::FixedOffset>,
- pub history_ts: chrono::DateTime<chrono::FixedOffset>,
+ #[serde(with = "time::serde::rfc3339")]
+ pub sync_ts: OffsetDateTime,
+ #[serde(with = "time::serde::rfc3339")]
+ pub history_ts: OffsetDateTime,
pub host: String,
}