Unify Dates logic and expand DoneDate format

This commit is contained in:
Joscha 2021-12-14 23:32:04 +01:00
parent 2e7ab3c4a1
commit c69af9bcde
8 changed files with 119 additions and 133 deletions

View file

@ -229,9 +229,14 @@ impl fmt::Display for DoneDate {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
DoneDate::Date { root } => write!(f, "{}", root),
DoneDate::DateWithTime { root, root_time } => write!(f, "{} {}", root, root_time),
DoneDate::DateTime { root, root_time } => write!(f, "{} {}", root, root_time),
DoneDate::DateToDate { root, other } => write!(f, "{} -- {}", root, other),
DoneDate::DateToDateWithTime {
DoneDate::DateTimeToTime {
root,
root_time,
other_time,
} => write!(f, "{} {} -- {}", root, root_time, other_time),
DoneDate::DateTimeToDateTime {
root,
root_time,
other,