From a10d6df430e127145388e8712436b8e76f123ba1 Mon Sep 17 00:00:00 2001 From: Finn Bear Date: Mon, 26 Jun 2023 04:02:26 -0700 Subject: [PATCH] Bugfix - JSON datetime string. (#2180) --- lib/src/api/opt/mod.rs | 4 ++-- lib/src/sql/datetime.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/api/opt/mod.rs b/lib/src/api/opt/mod.rs index 2461ffdf..cedef246 100644 --- a/lib/src/api/opt/mod.rs +++ b/lib/src/api/opt/mod.rs @@ -341,14 +341,14 @@ fn into_json(value: Value, simplify: bool) -> JsonValue { Value::Number(Number::Float(n)) => n.into(), Value::Number(Number::Decimal(n)) => json!(n), Value::Strand(strand) => match simplify { - true => strand.0.into(), + true => strand.to_raw().into(), false => json!(strand), }, Value::Duration(d) => match simplify { true => d.to_string().into(), false => json!(d), }, - Value::Datetime(d) => json!(d), + Value::Datetime(d) => d.to_raw().into(), Value::Uuid(uuid) => json!(uuid), Value::Array(arr) => JsonValue::Array(Array::from((arr, simplify)).0), Value::Object(obj) => JsonValue::Object(Object::from((obj, simplify)).0), diff --git a/lib/src/sql/datetime.rs b/lib/src/sql/datetime.rs index acc6c1e7..4f45bb98 100644 --- a/lib/src/sql/datetime.rs +++ b/lib/src/sql/datetime.rs @@ -91,7 +91,7 @@ impl Datetime { impl Display for Datetime { fn fmt(&self, f: &mut Formatter) -> fmt::Result { - Display::fmt("e_str(&self.0.to_rfc3339_opts(SecondsFormat::AutoSi, true)), f) + Display::fmt("e_str(&self.to_raw()), f) } }