Bugfix for #1011: begin/end date options
This commit is contained in:
parent
27c01e82b5
commit
e483faf7f0
@ -232,19 +232,19 @@ balancetypeopt rawopts =
|
|||||||
-- -p/--period options, using the given date to interpret relative date expressions.
|
-- -p/--period options, using the given date to interpret relative date expressions.
|
||||||
periodFromRawOpts :: Day -> RawOpts -> Period
|
periodFromRawOpts :: Day -> RawOpts -> Period
|
||||||
periodFromRawOpts d rawopts =
|
periodFromRawOpts d rawopts =
|
||||||
case (mearliestb, mlateste) of
|
case (mlastb, mlaste) of
|
||||||
(Nothing, Nothing) -> PeriodAll
|
(Nothing, Nothing) -> PeriodAll
|
||||||
(Just b, Nothing) -> PeriodFrom b
|
(Just b, Nothing) -> PeriodFrom b
|
||||||
(Nothing, Just e) -> PeriodTo e
|
(Nothing, Just e) -> PeriodTo e
|
||||||
(Just b, Just e) -> simplifyPeriod $
|
(Just b, Just e) -> simplifyPeriod $
|
||||||
PeriodBetween b e
|
PeriodBetween b e
|
||||||
where
|
where
|
||||||
mearliestb = case beginDatesFromRawOpts d rawopts of
|
mlastb = case beginDatesFromRawOpts d rawopts of
|
||||||
[] -> Nothing
|
[] -> Nothing
|
||||||
bs -> Just $ minimum bs
|
bs -> Just $ last bs
|
||||||
mlateste = case endDatesFromRawOpts d rawopts of
|
mlaste = case endDatesFromRawOpts d rawopts of
|
||||||
[] -> Nothing
|
[] -> Nothing
|
||||||
es -> Just $ maximum es
|
es -> Just $ last es
|
||||||
|
|
||||||
-- Get all begin dates specified by -b/--begin or -p/--period options, in order,
|
-- Get all begin dates specified by -b/--begin or -p/--period options, in order,
|
||||||
-- using the given date to interpret relative date expressions.
|
-- using the given date to interpret relative date expressions.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user