Improve time types

This commit is contained in:
Joshua Coles 2024-03-02 17:12:46 +00:00
parent 0f3c031b7a
commit b7da62536d
2 changed files with 6 additions and 6 deletions

View File

@ -68,9 +68,9 @@ impl Project {
workspace_id: Set(self.workspace_id as i64), workspace_id: Set(self.workspace_id as i64),
raw_json: Set(serde_json::to_value(self).unwrap()), raw_json: Set(serde_json::to_value(self).unwrap()),
color: Set(self.color.clone()), color: Set(self.color.clone()),
server_created_at: Set(chrono::DateTime::parse_from_rfc3339(&self.created_at).unwrap()), server_created_at: Set(self.created_at.clone().fixed_offset()),
server_updated_at: Set(chrono::DateTime::parse_from_rfc3339(&self.at).unwrap()), server_updated_at: Set(self.at.clone().fixed_offset()),
server_deleted_at: Set(self.server_deleted_at.map(|dt| chrono::DateTime::parse_from_rfc3339(&dt).unwrap())), server_deleted_at: Set(self.server_deleted_at.clone().fixed_offset()),
} }
} }

View File

@ -62,9 +62,9 @@ pub struct Project {
pub name: String, pub name: String,
pub active: bool, pub active: bool,
pub color: String, pub color: String,
pub at: String, pub at: DateTime<Utc>,
pub server_deleted_at: Option<String>, pub server_deleted_at: Option<DateTime<Utc>>,
pub created_at: String, pub created_at: DateTime<Utc>,
// cid: Option<serde_json::Value>, // cid: Option<serde_json::Value>,
// wid: i64, // wid: i64,