Bugfix - JSON datetime string. (#2180)
This commit is contained in:
parent
6d5dcfadd9
commit
a10d6df430
2 changed files with 3 additions and 3 deletions
|
@ -341,14 +341,14 @@ fn into_json(value: Value, simplify: bool) -> JsonValue {
|
||||||
Value::Number(Number::Float(n)) => n.into(),
|
Value::Number(Number::Float(n)) => n.into(),
|
||||||
Value::Number(Number::Decimal(n)) => json!(n),
|
Value::Number(Number::Decimal(n)) => json!(n),
|
||||||
Value::Strand(strand) => match simplify {
|
Value::Strand(strand) => match simplify {
|
||||||
true => strand.0.into(),
|
true => strand.to_raw().into(),
|
||||||
false => json!(strand),
|
false => json!(strand),
|
||||||
},
|
},
|
||||||
Value::Duration(d) => match simplify {
|
Value::Duration(d) => match simplify {
|
||||||
true => d.to_string().into(),
|
true => d.to_string().into(),
|
||||||
false => json!(d),
|
false => json!(d),
|
||||||
},
|
},
|
||||||
Value::Datetime(d) => json!(d),
|
Value::Datetime(d) => d.to_raw().into(),
|
||||||
Value::Uuid(uuid) => json!(uuid),
|
Value::Uuid(uuid) => json!(uuid),
|
||||||
Value::Array(arr) => JsonValue::Array(Array::from((arr, simplify)).0),
|
Value::Array(arr) => JsonValue::Array(Array::from((arr, simplify)).0),
|
||||||
Value::Object(obj) => JsonValue::Object(Object::from((obj, simplify)).0),
|
Value::Object(obj) => JsonValue::Object(Object::from((obj, simplify)).0),
|
||||||
|
|
|
@ -91,7 +91,7 @@ impl Datetime {
|
||||||
|
|
||||||
impl Display for Datetime {
|
impl Display for Datetime {
|
||||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue