mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-12 19:08:34 +03:00
histogram: honour the specified start or end dates
This commit is contained in:
parent
2b1ea5160f
commit
eac34e85fa
@ -23,14 +23,14 @@ histogram opts args j = do
|
||||
putStr $ showHistogram opts (optsToFilterSpec opts args t) j
|
||||
|
||||
showHistogram :: [Opt] -> FilterSpec -> Journal -> String
|
||||
showHistogram opts filterspec j = concatMap (printDayWith countBar) dayps
|
||||
showHistogram opts filterspec j = concatMap (printDayWith countBar) spanps
|
||||
where
|
||||
i = intervalFromOpts opts
|
||||
interval | i == NoInterval = Days 1
|
||||
| otherwise = i
|
||||
fullspan = journalDateSpan j
|
||||
days = filter (DateSpan Nothing Nothing /=) $ splitSpan interval fullspan
|
||||
dayps = [(s, filter (isPostingInDateSpan s) ps) | s <- days]
|
||||
span = datespan filterspec `orDatesFrom` journalDateSpan j
|
||||
spans = filter (DateSpan Nothing Nothing /=) $ splitSpan interval span
|
||||
spanps = [(s, filter (isPostingInDateSpan s) ps) | s <- spans]
|
||||
-- same as Register
|
||||
-- should count transactions, not postings ?
|
||||
ps = sortBy (comparing postingDate) $ filterempties $ filter matchapats $ filterdepth $ journalPostings j
|
||||
|
Loading…
Reference in New Issue
Block a user