use chrono::NaiveDate; use crate::files::commands::{DoneDate, Time}; #[derive(Debug, Clone, Copy)] struct Times { root: Time, other: Time, } #[derive(Debug, Clone, Copy)] pub struct Dates { root: NaiveDate, other: NaiveDate, times: Option, } impl Dates { pub fn new(root: NaiveDate, other: NaiveDate) -> Self { Self { root, other, times: None, } } pub fn new_with_time( root: NaiveDate, root_time: Time, other: NaiveDate, other_time: Time, ) -> Self { Self { root, other, times: Some(Times { root: root_time, other: other_time, }), } } pub fn root(&self) -> NaiveDate { self.root } pub fn other(&self) -> NaiveDate { self.other } pub fn root_time(&self) -> Option