Fix simple end dates being ignored
This commit is contained in:
parent
34a053cbe4
commit
696009d34e
1 changed files with 8 additions and 0 deletions
|
|
@ -30,6 +30,14 @@ impl From<&commands::DateSpec> for DateSpec {
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|delta| delta.into())
|
.map(|delta| delta.into())
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
if let Some(date) = spec.end {
|
||||||
|
// Strictly speaking, this could be out of range, but that would
|
||||||
|
// require a delta of about 6 million years. I'm not too worried...
|
||||||
|
let days = (date.value - spec.start).num_days() as i32;
|
||||||
|
end_delta
|
||||||
|
.steps
|
||||||
|
.insert(0, Spanned::new(date.span, DeltaStep::Day(days)));
|
||||||
|
}
|
||||||
if let Some(time) = spec.end_time {
|
if let Some(time) = spec.end_time {
|
||||||
end_delta
|
end_delta
|
||||||
.steps
|
.steps
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue