Simplify DoneDate when formatting

This commit is contained in:
Joscha 2022-01-09 16:40:17 +01:00
parent 20fc4bd3cc
commit 170e291ec5
4 changed files with 39 additions and 28 deletions

View file

@ -239,8 +239,7 @@ impl fmt::Display for Statement {
impl fmt::Display for DoneDate {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// TODO Remove redundant dates
match self {
match self.simplified() {
DoneDate::Date { root } => write!(f, "{}", root),
DoneDate::DateTime { root, root_time } => write!(f, "{} {}", root, root_time),
DoneDate::DateToDate { root, other } => write!(f, "{} -- {}", root, other),