Skip to content

Commit

Permalink
Fix string interpolation for datetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
eminence committed Feb 8, 2024
1 parent a62a71c commit 668ba5c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion numbat/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,14 @@ impl Vm {
Value::Quantity(q) => q.to_string(),
Value::Boolean(b) => b.to_string(),
Value::String(s) => s,
Value::DateTime(..) => "DateTimeTodo_1".to_string(),
Value::DateTime(dt, offset) => {
let l: chrono::DateTime<chrono::FixedOffset> =
chrono::DateTime::from_naive_utc_and_offset(
dt.naive_utc(),
offset,
);
format!("{}", l.to_rfc2822())
}
};
joined = part + &joined; // reverse order
}
Expand Down

0 comments on commit 668ba5c

Please sign in to comment.