Fix MOVE statement
This commit is contained in:
parent
cb7c87b8b2
commit
531a140c45
1 changed files with 5 additions and 1 deletions
|
|
@ -186,7 +186,11 @@ impl<'a> CommandState<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn eval_move(&mut self, span: Span, from: NaiveDate, to: NaiveDate) -> Result<()> {
|
fn eval_move(&mut self, span: Span, from: NaiveDate, to: NaiveDate) -> Result<()> {
|
||||||
if let Some(entry) = self.dated.remove(&from) {
|
if let Some(mut entry) = self.dated.remove(&from) {
|
||||||
|
if let Some(dates) = entry.dates {
|
||||||
|
let delta = to - from;
|
||||||
|
entry.dates = Some(dates.move_by(delta));
|
||||||
|
}
|
||||||
self.dated.insert(to, entry);
|
self.dated.insert(to, entry);
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue