Unify Dates logic and expand DoneDate format
This commit is contained in:
parent
2e7ab3c4a1
commit
c69af9bcde
8 changed files with 119 additions and 133 deletions
|
|
@ -652,7 +652,7 @@ fn parse_donedate(p: Pair<'_, Rule>) -> Result<DoneDate> {
|
|||
root: parse_datum(ps.pop().unwrap())?.value,
|
||||
},
|
||||
2 => match ps[1].as_rule() {
|
||||
Rule::time => DoneDate::DateWithTime {
|
||||
Rule::time => DoneDate::DateTime {
|
||||
root_time: parse_time(ps.pop().unwrap())?.value,
|
||||
root: parse_datum(ps.pop().unwrap())?.value,
|
||||
},
|
||||
|
|
@ -662,7 +662,12 @@ fn parse_donedate(p: Pair<'_, Rule>) -> Result<DoneDate> {
|
|||
},
|
||||
_ => unreachable!(),
|
||||
},
|
||||
4 => DoneDate::DateToDateWithTime {
|
||||
3 => DoneDate::DateTimeToTime {
|
||||
other_time: parse_time(ps.pop().unwrap())?.value,
|
||||
root_time: parse_time(ps.pop().unwrap())?.value,
|
||||
root: parse_datum(ps.pop().unwrap())?.value,
|
||||
},
|
||||
4 => DoneDate::DateTimeToDateTime {
|
||||
other_time: parse_time(ps.pop().unwrap())?.value,
|
||||
other: parse_datum(ps.pop().unwrap())?.value,
|
||||
root_time: parse_time(ps.pop().unwrap())?.value,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue