fix handling of the old database for in command
This commit is contained in:
parent
ee44b22efd
commit
acf2e30883
|
@ -1,3 +1,4 @@
|
|||
/target
|
||||
fake_old_config.yml
|
||||
.env
|
||||
timetrap.sqlite3
|
||||
|
|
|
@ -75,7 +75,7 @@ impl<'a> Command<'a> for InCommand {
|
|||
mod tests {
|
||||
use pretty_assertions::assert_eq;
|
||||
use ansi_term::Color::Yellow;
|
||||
use chrono::TimeZone;
|
||||
use chrono::{TimeZone, Local};
|
||||
|
||||
use crate::test_utils::PrettyString;
|
||||
use crate::database::SqliteDatabase;
|
||||
|
@ -183,7 +183,7 @@ mod tests {
|
|||
let e = d.entries_full(None, None).unwrap().into_iter().next().unwrap();
|
||||
|
||||
assert_eq!(e.note, Some("hola".into()));
|
||||
assert_eq!(e.start, Utc.from_utc_datetime(&now.naive_local()));
|
||||
assert_eq!(e.start, Utc.from_utc_datetime(&now.with_timezone(&Local).naive_local()));
|
||||
assert_eq!(e.end, None);
|
||||
assert_eq!(e.sheet, "default".to_owned());
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ fn local_to_utc(t: DateTime<Utc>) -> Result<DateTime<Utc>> {
|
|||
///
|
||||
/// Used to insert times into the old database format.
|
||||
fn utc_to_local(t: DateTime<Utc>) -> DateTime<Utc> {
|
||||
Utc.from_utc_datetime(&t.naive_local())
|
||||
Utc.from_utc_datetime(&t.with_timezone(&Local).naive_local())
|
||||
}
|
||||
|
||||
/// Maps an entire vector of entries from the old database format to the new,
|
||||
|
|
Loading…
Reference in New Issue