Move entries to a different time

This commit is contained in:
Joscha 2021-12-21 19:24:27 +01:00
parent 05a4582f13
commit 1ac39c69f2
9 changed files with 99 additions and 26 deletions

View file

@ -220,7 +220,14 @@ impl fmt::Display for Statement {
Statement::Until(Some(date)) => writeln!(f, "UNTIL {}", date),
Statement::Until(None) => writeln!(f, "UNTIL *"),
Statement::Except(date) => writeln!(f, "EXCEPT {}", date),
Statement::Move { from, to, .. } => writeln!(f, "MOVE {} TO {}", from, to),
Statement::Move {
from, to, to_time, ..
} => match (to, to_time) {
(None, None) => unreachable!(),
(Some(to), None) => writeln!(f, "MOVE {} TO {}", from, to),
(None, Some(to_time)) => writeln!(f, "MOVE {} TO {}", from, to_time),
(Some(to), Some(to_time)) => writeln!(f, "MOVE {} TO {} {}", from, to, to_time),
},
Statement::Remind(Some(delta)) => writeln!(f, "REMIND {}", delta),
Statement::Remind(None) => writeln!(f, "REMIND *"),
}