Implement basic structure for task evaluation
This commit is contained in:
parent
11399468e7
commit
21739c7314
3 changed files with 146 additions and 82 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use chrono::NaiveDate;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Time {
|
||||
pub hour: u8,
|
||||
pub min: u8,
|
||||
|
|
@ -285,7 +285,7 @@ pub enum Spec {
|
|||
Formula(FormulaSpec),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum DoneDate {
|
||||
Date {
|
||||
root: NaiveDate,
|
||||
|
|
@ -306,6 +306,17 @@ pub enum DoneDate {
|
|||
},
|
||||
}
|
||||
|
||||
impl DoneDate {
|
||||
pub fn root(&self) -> NaiveDate {
|
||||
match self {
|
||||
DoneDate::Date { root } => *root,
|
||||
DoneDate::DateWithTime { root, .. } => *root,
|
||||
DoneDate::DateToDate { root, .. } => *root,
|
||||
DoneDate::DateToDateWithTime { root, .. } => *root,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Done {
|
||||
pub date: Option<DoneDate>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue